Skip to content

Commit

Permalink
Merge pull request #7 from gewenyu99/test
Browse files Browse the repository at this point in the history
Update tests
  • Loading branch information
gewenyu99 authored Oct 1, 2024
2 parents 14b6eb0 + 34ccac3 commit 20d0802
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions javascript/tests/playwright/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ test("should load the homepage", async ({ page }) => {
});

test("should have a next button on the page", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.99);
expect(Math.random()).toBeLessThanOrEqual(1);
});

test("should display the login form correctly", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.95);
expect(Math.random()).toBeLessThanOrEqual(0.9995);
});

test("should navigate to the dashboard after login", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.9);
});
test("should display user profile information", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.95);
expect(Math.random()).toBeLessThanOrEqual(0.9599);
});

test("should allow user to update account settings", async ({ page }) => {
Expand All @@ -36,5 +36,5 @@ test("should load the pricing page", async ({ page }) => {
});

test("should display the contact form on the contact page", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.6999);
expect(Math.random()).toBeLessThanOrEqual(0.996999);
});
22 changes: 11 additions & 11 deletions javascript/tests/playwright/ui-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ test("should display error message for invalid login", async ({ page }) => {
});

test("should navigate to the dashboard after login", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.95);
expect(Math.random()).toBeLessThanOrEqual(0.999995);
});

test("should display the contact form on the contact page", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.99);
expect(Math.random()).toBeLessThanOrEqual(0.99999);
});

test("should load the pricing page", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.95);
});

test("should allow user to update account settings", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.9999);
expect(Math.random()).toBeLessThanOrEqual(0.9999999);
});

test("should have a next button on the page", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.999999);
});

test("should log out user and redirect to login page", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.9999);
expect(Math.random()).toBeLessThanOrEqual(0.999999);
});

test("should display the about us section", async ({ page }) => {
Expand All @@ -57,33 +57,33 @@ test("should show the FAQ page", async ({ page }) => {
});

test("should display the terms and conditions", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.96);
expect(Math.random()).toBeLessThanOrEqual(0.999996);
});

test("should load the blog page", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.94);
expect(Math.random()).toBeLessThanOrEqual(0.9999994);
});

test("should display the search results", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.93);
expect(Math.random()).toBeLessThanOrEqual(0.999993);
});

test("should show the privacy policy", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.22);
});

test("should display the site map", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.91);
expect(Math.random()).toBeLessThanOrEqual(0.9999991);
});

test("should load the careers page", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.9);
expect(Math.random()).toBeLessThanOrEqual(0.9999999);
});

test("should display the newsletter signup form", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.89);
expect(Math.random()).toBeLessThanOrEqual(0.99999989);
});

test("should show the testimonials section", async ({ page }) => {
expect(Math.random()).toBeLessThanOrEqual(0.88);
expect(Math.random()).toBeLessThanOrEqual(0.999999988);
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "index.js",
"scripts": {
"dev": "node javascript/app.js",
"test": "npx playwright test"
"test": "npx playwright test --retries=0"
},
"dependencies": {
"express": "^4.21.0",
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default defineConfig({
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
retries: process.env.CI ? 0 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
Expand Down

0 comments on commit 20d0802

Please sign in to comment.