From e00ccb577238758efd0e9c66c1796ff5785afe42 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Thu, 12 Dec 2024 16:57:42 -0800 Subject: [PATCH 1/2] feat: Rename rules to actions --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index de436bb..6694069 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Currents Automation Rules with Playwright +# Currents Actions with Playwright -Playwright [Automation Rules](https://docs.currents.dev/guides/automation-rules) for Currents. +[Currents Actions](https://docs.currents.dev/guides/currents-actions) for Playwright. -This is a simple example Playwright test project, that shows the different ways to configure the Currents Playwright fixtures to apply Rule Automation. +This is a simple example Playwright test project, that shows the different ways to configure the Currents Playwright fixtures to apply Actions. ## Setup @@ -11,12 +11,12 @@ This is a simple example Playwright test project, that shows the different ways - Update `playwright.config.ts` with Currents [record key](https://docs.currents.dev/guides/record-key) and [project id](https://docs.currents.dev/dashboard/projects/project-settings) - Run `npm run test` for running tests, behind the scenes: - runs playwright tests - - applied automation rules during the run + - applied Currents Actions during the run - sends results to the Currents dashboard -## Rules Creation +## Actions Creation -Rules are created in the Currents Dashboard (see https://docs.currents.dev/guides/automation-rules#creating-rules-in-currents for more info) +Actions are created in the Currents Dashboard (see https://docs.currents.dev/guides/automation-rules#creating-rules-in-currents for more info) Screenshot 2024-12-10 at 3 22 45 PM From 2443359869783ccd23b9229f20bd78a7b1b4104c Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Thu, 12 Dec 2024 17:02:59 -0800 Subject: [PATCH 2/2] chore: Update action examples --- README.md | 2 +- basic/{rules.spec.ts => actions.spec.ts} | 26 ++++++++++++------------ basic/test.ts | 2 +- package-lock.json | 8 ++++---- package.json | 9 ++++---- 5 files changed, 23 insertions(+), 24 deletions(-) rename basic/{rules.spec.ts => actions.spec.ts} (52%) diff --git a/README.md b/README.md index 6694069..72238fc 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Actions are created in the Currents Dashboard (see https://docs.currents.dev/gui ## Examples -- Run `npm run test:reporter` for using [`playwight test`](https://docs.currents.dev/getting-started/playwright/you-first-playwright-run#using-reporter-configuration) command with Currents loaded as a reporter +- Run `npm run test` for using [`playwight test`](https://docs.currents.dev/getting-started/playwright/you-first-playwright-run#using-reporter-configuration) command with Currents loaded as a reporter - Run `npm run test:pwc` for using [`pwc`](https://docs.currents.dev/getting-started/playwright/you-first-playwright-run#using-the-cli) command - Run `npm run test:pwc-p` for [orchestrated](https://docs.currents.dev/guides/parallelization-guide/pw-parallelization/playwright-orchestration) runs diff --git a/basic/rules.spec.ts b/basic/actions.spec.ts similarity index 52% rename from basic/rules.spec.ts rename to basic/actions.spec.ts index 6485401..1e65882 100644 --- a/basic/rules.spec.ts +++ b/basic/actions.spec.ts @@ -2,20 +2,20 @@ import { expect } from "@playwright/test"; import { test } from "./test"; /** - * 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 | 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 @@ -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 | 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 diff --git a/basic/test.ts b/basic/test.ts index 82f1c58..a037c29 100644 --- a/basic/test.ts +++ b/basic/test.ts @@ -7,5 +7,5 @@ import { test as base } from "@playwright/test"; export const test = base.extend({ ...fixtures.baseFixtures, - ...fixtures.rulesFixtures, + ...fixtures.actionFixtures, }); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5a8a27e..e1ecf1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MIT", "devDependencies": { - "@currents/playwright": "^1.9.0-beta.1", + "@currents/playwright": "^1.9.0-beta.2", "@eslint/js": "^9.16.0", "@playwright/test": "^1.49.1", "@types/node": "^22.10.2", @@ -212,9 +212,9 @@ } }, "node_modules/@currents/playwright": { - "version": "1.9.0-beta.1", - "resolved": "https://registry.npmjs.org/@currents/playwright/-/playwright-1.9.0-beta.1.tgz", - "integrity": "sha512-27MfxEZrJIgQPkQCXTwsh1naYOklWcA/J3JjMITmLnqqIeQbHw85c/9Oi2JHzVk0XDxf06chRi5ew5VUxb/Q4g==", + "version": "1.9.0-beta.2", + "resolved": "https://registry.npmjs.org/@currents/playwright/-/playwright-1.9.0-beta.2.tgz", + "integrity": "sha512-WOTi7+w8bho5Mnnzy6yxz/gGXczNLgbQyYUebZMI1e4/w4B9dTmbI4BEApyaoM3KV6bLHhk8FavWzqjmrUDPFA==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", diff --git a/package.json b/package.json index 638a8e2..eb9235d 100644 --- a/package.json +++ b/package.json @@ -4,16 +4,15 @@ "description": "An example repository on how to setup Currents Rules with Playwright Fixtures", "main": "index.js", "scripts": { - "test": "playwright test", - "test:pwc" : "pwc", - "test:pwp" : "pwc-p", - "test:reporter" : "playwright test -c playwright.config.reporter.ts", + "test": "playwright test -c playwright.config.reporter.ts", + "test:pwc": "pwc", + "test:pwp": "pwc-p", "lint": "eslint ./basic" }, "author": "", "license": "MIT", "devDependencies": { - "@currents/playwright": "^1.9.0-beta.1", + "@currents/playwright": "^1.9.0-beta.2", "@eslint/js": "^9.16.0", "@playwright/test": "^1.49.1", "@types/node": "^22.10.2",