Skip to content

Commit

Permalink
Merge pull request currents-dev#44 from currents-dev/feat/rename-rule…
Browse files Browse the repository at this point in the history
…s-to-actions

[CSR-1979] feat: Rename rules to fixtures
  • Loading branch information
twk3 authored Dec 13, 2024
2 parents d6ce0d1 + 6c5b025 commit efa6708
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
26 changes: 13 additions & 13 deletions basic/8-rules.spec.ts → basic/8-actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ import { expect } from "@playwright/test";
import { test } from "./base.ts";

/**
* All tests in this file are matched with a Currents Quarantine Rule based on filename.
* See the `rules` fixture in `base.ts` to see how the rules fixtures were configured,
* and the docs for more information on how to configure rules: https://docs.currents.dev/guides/automation-rules
* All tests in this file are matched with a Currents Quarantine Action based on filename.
* See the `action` fixture in `base.ts` to see how the action fixtures were configured,
* and the docs for more information on how to configure actions: https://docs.currents.dev/guides/currents-actions
*
*/

/**
* This is a failing test that will be quarantined by the file based rule
*
* | field | operation | value | - | action |
* | ----- | --------- | --------------- | --- | ---------- |
* | File | is | 8-rules.spec.ts | -> | Quarantine |
* | field | operation | value | - | action |
* | ----- | --------- | ----------------- | --- | ---------- |
* | File | is | 8-actions.spec.ts | -> | Quarantine |
*/
test("rules quarantine test", async ({ page }) => {
test("action quarantine test", async ({ page }) => {
await page.goto("https://demo.playwright.dev/todomvc");

// Use locators to represent a selector and re-use them
Expand All @@ -28,14 +28,14 @@ test("rules quarantine test", async ({ page }) => {
});

/**
* This tests will be completely skipped by a rule that matches fileName + test name
* This tests will be completely skipped by an Action that matches fileName + test name
*
* | field | operation | value | - | action |
* | ----- | --------- | --------------- | ---- | ---------- |
* | File | is | 8-rules.spec.ts | And | |
* | Title | is | rules skip test | -> | Skip |
* | field | operation | value | - | action |
* | ----- | --------- | ----------------- | ---- | ---------- |
* | File | is | 8-actions.spec.ts | And | |
* | Title | is | action skip test | -> | Skip |
*/
test("rules skip test", async ({ page }) => {
test("action skip test", async ({ page }) => {
await page.goto("https://demo.playwright.dev/todomvc");

// Use locators to represent a selector and re-use them
Expand Down
2 changes: 1 addition & 1 deletion basic/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import { test as base } from "@playwright/test";

export const test = base.extend<CurrentsFixtures, CurrentsWorkerFixtures>({
...fixtures.baseFixtures,
...fixtures.rulesFixtures,
...fixtures.actionFixtures,
});
2 changes: 2 additions & 0 deletions basic/pw.config.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const config = defineConfig<CurrentsFixtures, CurrentsWorkerFixtures>({
trace: "on",
video: "on",
screenshot: "on",
// We can disable Currents fixtures if no project ID is provided
currentsFixturesEnabled: !!process.env.CURRENTS_PROJECT_ID,
},

projects: [
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@argos-ci/cli": "^2.4.3",
"@argos-ci/playwright": "^3.6.1",
"@axe-core/playwright": "^4.4.4",
"@currents/playwright": "^1.9.0-beta.0",
"@currents/playwright": "^1.9.0-beta.2",
"@playwright/test": "^1.49.0",
"@types/express": "^4.17.13",
"@typescript-eslint/eslint-plugin": "^5.22.0",
Expand Down

0 comments on commit efa6708

Please sign in to comment.