| load("@build_bazel_rules_nodejs//packages/cypress:index.bzl", "cypress_web_test") |
| load("@build_bazel_rules_nodejs//packages/concatjs:index.bzl", "ts_library") |
| load("@build_bazel_rules_nodejs//:index.bzl", "js_library") |
| |
| js_library( |
| name = "lib_plugin_file", |
| srcs = ["lib_plugin.js"], |
| deps = [ |
| "@cypress_deps//:node_modules", |
| ], |
| ) |
| |
| ts_library( |
| name = "plugin_file", |
| testonly = True, |
| srcs = ["plugin.ts"], |
| tags = ["cypress"], |
| tsconfig = ":tsconfig.json", |
| deps = [ |
| "@cypress_deps//:node_modules", |
| ], |
| ) |
| |
| ts_library( |
| name = "hello_spec", |
| testonly = True, |
| srcs = ["hello.spec.ts"], |
| tags = ["cypress"], |
| tsconfig = ":tsconfig.json", |
| deps = [ |
| "@cypress_deps//:node_modules", |
| ], |
| ) |
| |
| cypress_web_test( |
| name = "test", |
| srcs = [ |
| "world.spec.js", |
| ":hello_spec", |
| ], |
| config_file = "cypress.json", |
| cypress_npm_package = "@cypress_deps//cypress", |
| data = [ |
| "@cypress_deps//rxjs", |
| ], |
| plugin_file = ":plugin_file", |
| tags = ["cypress"], |
| ) |
| |
| cypress_web_test( |
| name = "lib_test", |
| srcs = [ |
| "world.spec.js", |
| ":hello_spec", |
| ], |
| config_file = "cypress.json", |
| cypress_npm_package = "@cypress_deps//cypress", |
| data = [ |
| "@cypress_deps//rxjs", |
| ], |
| plugin_file = ":lib_plugin_file", |
| tags = [ |
| "cypress", |
| # Currently we assume port 3000 is fixed, |
| # so only one can run at a time. |
| # This should simply require adding an "exclusive" tag |
| # (or choosing a dynamic port) |
| # However exclusive seems to change the spawn strategy? |
| # so that it fails with |
| # Error: Cannot find module 'cypress/lib/cli' |
| "manual", |
| ], |
| ) |