diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f4908f3..8e27d55 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,10 +30,6 @@ jobs: - name: Build rules_playwright run: bazelisk build //... - - name: Build and Test WORKSPACE example - working-directory: examples/workspace - run: bazelisk test //... - - name: Build and Test MODULE.bazel example working-directory: examples/rules_js run: bazelisk test //... --test_output=all diff --git a/examples/rules_js/playwright.config.ts b/examples/rules_js/playwright.config.ts index 0421ec4..6089eba 100644 --- a/examples/rules_js/playwright.config.ts +++ b/examples/rules_js/playwright.config.ts @@ -19,6 +19,7 @@ export default defineConfig({ animations: "disabled", caret: "hide", threshold: 0.02, + maxDiffPixelRatio: 0.02, }, }, diff --git a/examples/workspace/.bazelrc b/examples/workspace/.bazelrc deleted file mode 100644 index cb5043b..0000000 --- a/examples/workspace/.bazelrc +++ /dev/null @@ -1 +0,0 @@ -common --noenable_bzlmod --enable_workspace diff --git a/examples/workspace/.bazelversion b/examples/workspace/.bazelversion deleted file mode 100644 index 47da986..0000000 --- a/examples/workspace/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -9.1.0 diff --git a/examples/workspace/BUILD.bazel b/examples/workspace/BUILD.bazel deleted file mode 100644 index 9d9edd1..0000000 --- a/examples/workspace/BUILD.bazel +++ /dev/null @@ -1,34 +0,0 @@ -load("@npm//:@playwright/test/package_json.bzl", playwright_bin = "bin") -load("@npm//:defs.bzl", "npm_link_all_packages") - -npm_link_all_packages(name = "node_modules") - -playwright_bin.playwright_test( - name = "test", - args = ["test"], - data = [ - "playwright.config.ts", - "simple.e2e.ts", - "//:node_modules/@playwright/test", - "@playwright//:chromium-headless-shell", - ], - env = { - "PLAYWRIGHT_BROWSERS_PATH": "$(rootpath @playwright//:chromium-headless-shell)/../", - }, - tags = ["requires-network"], -) - -playwright_bin.playwright_test( - name = "test_2", - args = ["test"], - data = [ - "playwright.config.ts", - "simple.e2e.ts", - "//:node_modules/@playwright/test", - "@playwright_2//:chromium-headless-shell", - ], - env = { - "PLAYWRIGHT_BROWSERS_PATH": "$(rootpath @playwright_2//:chromium-headless-shell)/../", - }, - tags = ["requires-network"], -) diff --git a/examples/workspace/WORKSPACE.bazel b/examples/workspace/WORKSPACE.bazel deleted file mode 100644 index ee4ee97..0000000 --- a/examples/workspace/WORKSPACE.bazel +++ /dev/null @@ -1,74 +0,0 @@ -workspace(name = "workspace_example") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "aspect_rules_js", - sha256 = "d66f8abf914a0454a69181b7b17acaae56d7b0e2784cb26b40cb3273c4d836d1", - strip_prefix = "rules_js-2.2.0", - url = "https://github.com/aspect-build/rules_js/releases/download/v2.2.0/rules_js-v2.2.0.tar.gz", -) - -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") - -rules_js_dependencies() - -load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains") - -rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) - -load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock") - -npm_translate_lock( - name = "npm", - pnpm_lock = "//:pnpm-lock.yaml", -) - -load("@npm//:repositories.bzl", "npm_repositories") - -npm_repositories() - -local_repository( - name = "mrmeku_rules_playwright", - path = "../..", -) - -http_archive( - name = "playwright-core-1.58.1", - build_file_content = """ -exports_files([ - "browsers.json" -]) -""", - strip_prefix = "package", - url = "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.1.tgz", -) - -load("@mrmeku_rules_playwright//playwright:repositories.bzl", "define_browsers", "playwright_repository") - -define_browsers( - name = "browsers_index", - browsers_json = "@playwright-core-1.58.1//:browsers.json", -) - -load("@browsers_index//:browsers.bzl", "fetch_browsers") - -fetch_browsers() - -playwright_repository( - name = "playwright", - browsers_workspace_name_prefix = "browsers_index", - playwright_version = "1.58.1", - rules_playwright_cannonical_name = "mrmeku_rules_playwright", -) - -# ########################################################### -# # Example loading playwright version from package.json. # -# ########################################################### - -playwright_repository( - name = "playwright_2", - browsers_workspace_name_prefix = "browsers_index", - playwright_version_from = "//:package.json", - rules_playwright_cannonical_name = "mrmeku_rules_playwright", -) diff --git a/examples/workspace/package.json b/examples/workspace/package.json deleted file mode 100644 index 312be6d..0000000 --- a/examples/workspace/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "devDependencies": { - "@playwright/test": "1.58.1" - }, - "pnpm": { - "onlyBuiltDependencies": [] - } -} diff --git a/examples/workspace/playwright.config.ts b/examples/workspace/playwright.config.ts deleted file mode 100644 index 622c9f3..0000000 --- a/examples/workspace/playwright.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { defineConfig } from "@playwright/test"; - -export default defineConfig({ - testMatch: /.*\.e2e.ts/, -}); diff --git a/examples/workspace/pnpm-lock.yaml b/examples/workspace/pnpm-lock.yaml deleted file mode 100644 index 46ab5af..0000000 --- a/examples/workspace/pnpm-lock.yaml +++ /dev/null @@ -1,52 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@playwright/test': - specifier: 1.58.1 - version: 1.58.1 - -packages: - - '@playwright/test@1.58.1': - resolution: {integrity: sha512-6LdVIUERWxQMmUSSQi0I53GgCBYgM2RpGngCPY7hSeju+VrKjq3lvs7HpJoPbDiY5QM5EYRtRX5fvrinnMAz3w==} - engines: {node: '>=18'} - hasBin: true - - fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - - playwright-core@1.58.1: - resolution: {integrity: sha512-bcWzOaTxcW+VOOGBCQgnaKToLJ65d6AqfLVKEWvexyS3AS6rbXl+xdpYRMGSRBClPvyj44njOWoxjNdL/H9UNg==} - engines: {node: '>=18'} - hasBin: true - - playwright@1.58.1: - resolution: {integrity: sha512-+2uTZHxSCcxjvGc5C891LrS1/NlxglGxzrC4seZiVjcYVQfUa87wBL6rTDqzGjuoWNjnBzRqKmF6zRYGMvQUaQ==} - engines: {node: '>=18'} - hasBin: true - -snapshots: - - '@playwright/test@1.58.1': - dependencies: - playwright: 1.58.1 - - fsevents@2.3.2: - optional: true - - playwright-core@1.58.1: {} - - playwright@1.58.1: - dependencies: - playwright-core: 1.58.1 - optionalDependencies: - fsevents: 2.3.2 diff --git a/examples/workspace/simple.e2e.ts b/examples/workspace/simple.e2e.ts deleted file mode 100644 index bdc2417..0000000 --- a/examples/workspace/simple.e2e.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { test, expect } from "@playwright/test"; - -test("basic test", async ({ page }) => { - await page.goto("https://bazel.build/"); - await expect(page.getByText("{ Fast, Correct } — Choose two").first()).toBeVisible(); -});