Browse Source

chore: rename `playwrite` to `playwright` (#1203)

I assume this was a mistake and not intentional.
Brian Donovan 1 năm trước cách đây
mục cha
commit
947b7b650e

+ 1 - 1
.github/workflows/main.yml

@@ -13,7 +13,7 @@ on:
       - lib.rs
       - Cargo.toml
       - Makefile.toml
-      - playwrite-tests/**
+      - playwright-tests/**
 
   pull_request:
     types: [opened, synchronize, reopened, ready_for_review]

+ 2 - 2
.gitignore

@@ -1,6 +1,6 @@
 /target
-/playwrite-tests/web/dist
-/playwrite-tests/fullstack/dist
+/playwright-tests/web/dist
+/playwright-tests/fullstack/dist
 /dist
 Cargo.lock
 .DS_Store

+ 4 - 4
Cargo.toml

@@ -35,10 +35,10 @@ members = [
     # Full project examples
     "examples/tailwind",
     "examples/PWA-example",
-    # Playwrite tests
-    "playwrite-tests/liveview",
-    "playwrite-tests/web",
-    "playwrite-tests/fullstack",
+    # Playwright tests
+    "playwright-tests/liveview",
+    "playwright-tests/web",
+    "playwright-tests/fullstack",
 ]
 exclude = ["examples/mobile_demo"]
 

+ 0 - 0
playwrite-tests/fullstack.spec.js → playwright-tests/fullstack.spec.js


+ 0 - 0
playwrite-tests/fullstack/.gitignore → playwright-tests/fullstack/.gitignore


+ 1 - 1
playwrite-tests/fullstack/Cargo.toml → playwright-tests/fullstack/Cargo.toml

@@ -1,5 +1,5 @@
 [package]
-name = "dioxus-playwrite-fullstack-test"
+name = "dioxus-playwright-fullstack-test"
 version = "0.1.0"
 edition = "2021"
 publish = false

+ 1 - 1
playwrite-tests/fullstack/src/main.rs → playwright-tests/fullstack/src/main.rs

@@ -1,4 +1,4 @@
-// This test is used by playwrite configured in the root of the repo
+// This test is used by playwright configured in the root of the repo
 // Tests:
 // - Server functions
 // - SSR

+ 0 - 0
playwrite-tests/liveview.spec.js → playwright-tests/liveview.spec.js


+ 2 - 2
playwrite-tests/liveview/Cargo.toml → playwright-tests/liveview/Cargo.toml

@@ -1,8 +1,8 @@
 [package]
-name = "dioxus-playwrite-liveview-test"
+name = "dioxus-playwright-liveview-test"
 version = "0.0.1"
 edition = "2021"
-description = "Playwrite test for Dioxus Liveview"
+description = "Playwright test for Dioxus Liveview"
 license = "MIT/Apache-2.0"
 publish = false
 

+ 1 - 1
playwrite-tests/liveview/src/main.rs → playwright-tests/liveview/src/main.rs

@@ -1,4 +1,4 @@
-// This test is used by playwrite configured in the root of the repo
+// This test is used by playwright configured in the root of the repo
 
 use axum::{extract::ws::WebSocketUpgrade, response::Html, routing::get, Router};
 use dioxus::prelude::*;

+ 0 - 0
playwrite-tests/web.spec.js → playwright-tests/web.spec.js


+ 2 - 2
playwrite-tests/web/Cargo.toml → playwright-tests/web/Cargo.toml

@@ -1,8 +1,8 @@
 [package]
-name = "dioxus-playwrite-web-test"
+name = "dioxus-playwright-web-test"
 version = "0.0.1"
 edition = "2021"
-description = "Playwrite test for Dioxus Web"
+description = "Playwright test for Dioxus Web"
 license = "MIT/Apache-2.0"
 publish = false
 

+ 1 - 1
playwrite-tests/web/src/main.rs → playwright-tests/web/src/main.rs

@@ -1,4 +1,4 @@
-// This test is used by playwrite configured in the root of the repo
+// This test is used by playwright configured in the root of the repo
 
 use dioxus::prelude::*;
 use dioxus_web::use_eval;

+ 15 - 13
playwright.config.js

@@ -1,6 +1,6 @@
 // @ts-check
-const { defineConfig, devices } = require('@playwright/test');
-const path = require('path');
+const { defineConfig, devices } = require("@playwright/test");
+const path = require("path");
 
 /**
  * Read environment variables from file.
@@ -12,7 +12,7 @@ const path = require('path');
  * @see https://playwright.dev/docs/test-configuration
  */
 module.exports = defineConfig({
-  testDir: './playwrite-tests',
+  testDir: "./playwright-tests",
   /* Run tests in files in parallel */
   fullyParallel: true,
   /* Fail the build on CI if you accidentally left test.only in the source code. */
@@ -22,21 +22,21 @@ module.exports = defineConfig({
   /* Opt out of parallel tests on CI. */
   workers: process.env.CI ? 1 : undefined,
   /* Reporter to use. See https://playwright.dev/docs/test-reporters */
-  reporter: 'html',
+  reporter: "html",
   /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
   use: {
     /* Base URL to use in actions like `await page.goto('/')`. */
     // baseURL: 'http://127.0.0.1:3000',
 
     /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
-    trace: 'on-first-retry',
+    trace: "on-first-retry",
   },
 
   /* Configure projects for major browsers */
   projects: [
     {
-      name: 'chromium',
-      use: { ...devices['Desktop Chrome'] },
+      name: "chromium",
+      use: { ...devices["Desktop Chrome"] },
     },
 
     // {
@@ -73,27 +73,29 @@ module.exports = defineConfig({
   /* Run your local dev server before starting the tests */
   webServer: [
     {
-      command: 'cargo run --package dioxus-playwrite-liveview-test --bin dioxus-playwrite-liveview-test',
+      command:
+        "cargo run --package dioxus-playwright-liveview-test --bin dioxus-playwright-liveview-test",
       port: 3030,
       timeout: 10 * 60 * 1000,
       reuseExistingServer: !process.env.CI,
       stdout: "pipe",
     },
     {
-      cwd: path.join(process.cwd(), 'playwrite-tests', 'web'),
-      command: 'dioxus serve',
+      cwd: path.join(process.cwd(), "playwright-tests", "web"),
+      command: "dioxus serve",
       port: 8080,
       timeout: 10 * 60 * 1000,
       reuseExistingServer: !process.env.CI,
       stdout: "pipe",
     },
     {
-      cwd: path.join(process.cwd(), 'playwrite-tests', 'fullstack'),
-      command: 'dioxus build --features web\ncargo run --release --features ssr --no-default-features',
+      cwd: path.join(process.cwd(), "playwright-tests", "fullstack"),
+      command:
+        "dioxus build --features web\ncargo run --release --features ssr --no-default-features",
       port: 3333,
       timeout: 10 * 60 * 1000,
       reuseExistingServer: !process.env.CI,
       stdout: "pipe",
-    }
+    },
   ],
 });