Fix playwright (#2867)

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2023-06-13 15:43:28 -06:00
committed by GitHub
parent 253053cc23
commit 0904f83627
8 changed files with 17 additions and 18 deletions

View File

@@ -1411,8 +1411,8 @@ jobs:
yarn add -D nyc
yarn add -D react-app-rewired
yarn add -D create-react-app
yarn add -D @playwright/test
yarn init -y
yarn add --dev @playwright/test
echo "yarn install"
yarn install
@@ -1434,6 +1434,8 @@ jobs:
run: |
echo "Run tests under playwright folder only"
cd $GITHUB_WORKSPACE/portal-ui
yarn remove playwright
yarn add --dev @playwright/test
echo "npx playwright test"
npx playwright test # To run the tests
echo "npx nyc report"

View File

@@ -22,10 +22,11 @@ test.use({ storageState: minioadminFile });
test.beforeEach(async ({ page }) => {
await page.goto(BUCKET_LIST_PAGE);
await page.waitForTimeout(1000);
});
test("create a new bucket", async ({ page }) => {
await page.getByRole("link", { name: "Buckets Buckets" }).click();
await page.getByRole("button", { name: "Buckets" }).click();
await page.getByRole("button", { name: "Create Bucket" }).click();
await page.getByLabel("Bucket Name*").click();
@@ -33,6 +34,8 @@ test("create a new bucket", async ({ page }) => {
await page.getByLabel("Bucket Name*").fill(bucketName);
await page.getByRole("button", { name: "Create Bucket" }).click();
await page.getByPlaceholder("Search Buckets").fill(bucketName);
await expect(page.locator(`#manageBucket-${bucketName}`)).toBeTruthy();
const bucketLocatorEl = `#manageBucket-${bucketName}`;
await page.locator(bucketLocatorEl).click();
@@ -44,7 +47,7 @@ test("create a new bucket", async ({ page }) => {
});
test("invalid bucket name", async ({ page }) => {
await page.getByRole("link", { name: "Buckets Buckets" }).click();
await page.getByRole("button", { name: "Buckets" }).click();
await page.getByRole("button", { name: "Create Bucket" }).click();
await page.getByLabel("Bucket Name*").click();
await page.getByLabel("Bucket Name*").fill("invalid name");

View File

@@ -26,8 +26,8 @@ test.beforeEach(async ({ page }) => {
});
test("Add a new group", async ({ page }) => {
await page.getByRole("button", { name: "Identity Identity" }).click();
await page.getByRole("link", { name: "Groups Groups" }).click();
await page.getByRole("button", { name: "Identity" }).click();
await page.getByRole("button", { name: "Groups" }).click();
await page.getByRole("button", { name: "Create Group" }).click();
const groupName = `new-group-${generateUUID()}`;

View File

@@ -25,7 +25,7 @@ test.beforeEach(async ({ page }) => {
});
test("Can create a policy", async ({ page }) => {
await page.getByRole("link", { name: "Policies" }).click();
await page.getByRole("button", { name: "Policies" }).click();
await page.getByRole("button", { name: "Create Policy" }).click();
await page.getByLabel("Policy Name").click();

View File

@@ -67,7 +67,7 @@
},
"proxy": "http://localhost:9090/",
"devDependencies": {
"@playwright/test": "^1.34.3",
"@playwright/test": "^1.35.0",
"@types/lodash": "^4.14.195",
"@types/luxon": "^3.3.0",
"@types/minio": "^7.1.0",
@@ -88,7 +88,6 @@
"customize-cra": "^1.0.0",
"minio": "^7.1.1",
"nyc": "^15.1.0",
"playwright": "^1.34.3",
"prettier": "2.8.8",
"react-app-rewire-hot-loader": "^2.0.1",
"react-app-rewired": "^2.2.1",

View File

@@ -27,7 +27,7 @@ export default defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
workers: process.env.CI ? 3 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */

View File

@@ -180,12 +180,12 @@ jobs:
echo "Install dependencies"
cd $GITHUB_WORKSPACE/portal-ui
yarn add -D playwright
yarn add -D @playwright/test
yarn add -D babel-plugin-istanbul
yarn add -D nyc
yarn add -D react-app-rewired
yarn add -D create-react-app
yarn init -y
yarn add --dev @playwright/test
echo "yarn install"
yarn install
@@ -207,6 +207,8 @@ jobs:
run: |
echo "Run tests under playwright folder only"
cd $GITHUB_WORKSPACE/portal-ui
yarn remove playwright
yarn add --dev @playwright/test
echo "npx playwright test"
npx playwright test # To run the tests
echo "npx nyc report"

View File

@@ -1981,7 +1981,7 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"
"@playwright/test@^1.34.3":
"@playwright/test@^1.35.0":
version "1.35.0"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.35.0.tgz#532603399a0dd46731fbc31a0df5ce357dafa486"
integrity sha512-6qXdd5edCBynOwsz1YcNfgX8tNWeuS9fxy5o59D0rvHXxRtjXRebB4gE4vFVfEMXl/z8zTnAzfOs7aQDEs8G4Q==
@@ -9233,13 +9233,6 @@ playwright-core@1.35.0:
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.35.0.tgz#b7871b742b4a5c8714b7fa2f570c280a061cb414"
integrity sha512-muMXyPmIx/2DPrCHOD1H1ePT01o7OdKxKj2ebmCAYvqhUy+Y1bpal7B0rdoxros7YrXI294JT/DWw2LqyiqTPA==
playwright@^1.34.3:
version "1.35.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.35.0.tgz#4e3b3ea2495d6fd671700f77b2f97b3adedf80f1"
integrity sha512-xhFhsoBmKPQfj3dM+HbIiFVlqRCZp2rwdJd/QFd9YBuidabo3TkVv0iuxPQ4vZoMwtSI7qzjY93f5ohdC97hww==
dependencies:
playwright-core "1.35.0"
pngjs@^3.3.1:
version "3.4.0"
resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f"