-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from currents-dev/feat/rules-example
[CSR-1773] feat: Add rules example for github actions
- Loading branch information
Showing
25 changed files
with
765 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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 | ||
* | ||
*/ | ||
|
||
/** | ||
* 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 | | ||
*/ | ||
test("rules quarantine test", async ({ page }) => { | ||
await page.goto("https://demo.playwright.dev/todomvc"); | ||
|
||
// Use locators to represent a selector and re-use them | ||
const inputBox = page.locator("input.new-todo"); | ||
const todoList = page.locator(".todo-list"); | ||
|
||
await inputBox.fill("Learn JavaScript"); | ||
await inputBox.press("Enter"); | ||
await expect(todoList).toHaveText("Learn Playwright"); | ||
}); | ||
|
||
/** | ||
* This tests will be completely skipped by a rule that matches fileName + test name | ||
* | ||
* | field | operation | value | - | action | | ||
* | ----- | --------- | --------------- | ---- | ---------- | | ||
* | File | is | 8-rules.spec.ts | And | | | ||
* | Title | is | rules skip test | -> | Skip | | ||
*/ | ||
test("rules skip test", async ({ page }) => { | ||
await page.goto("https://demo.playwright.dev/todomvc"); | ||
|
||
// Use locators to represent a selector and re-use them | ||
const inputBox = page.locator("input.new-todo"); | ||
const todoList = page.locator(".todo-list"); | ||
|
||
await inputBox.fill("Learn JavaScript"); | ||
await inputBox.press("Enter"); | ||
await expect(todoList).toHaveText("Learn JavaScript"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { | ||
CurrentsFixtures, | ||
CurrentsWorkerFixtures, | ||
fixtures, | ||
} from "@currents/playwright"; | ||
import { test as base } from "@playwright/test"; | ||
|
||
export const test = base.extend<CurrentsFixtures, CurrentsWorkerFixtures>({ | ||
...fixtures.baseFixtures, | ||
...fixtures.rulesFixtures, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.