Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added initial playwright configuration #49

Merged

Conversation

VaibhavMalik4187
Copy link
Contributor

  • Added basic playwright configuration in the playwright-action directory.
  • Created a new playwright workflow to run playwright tests.

Notes for Reviewers

This PR fixes #

  • Yes, I signed my commits.

@VaibhavMalik4187 VaibhavMalik4187 force-pushed the playwright-configuration branch 3 times, most recently from ee4a948 to 4efbf80 Compare September 4, 2023 06:19
@VaibhavMalik4187
Copy link
Contributor Author

@leecalcote Let's prototype the Playwright configuration here.

@leecalcote leecalcote self-requested a review September 4, 2023 12:58
- Created the `playwright-action` directory.
- Added basic playwright configuration in the playwright-action
  directory.
- Created a new playwright workflow to run playwright tests.

Signed-off-by: VaibhavMalik4187 <[email protected]>
@VaibhavMalik4187
Copy link
Contributor Author

The situation is very dicey here. Tests are randomly passing and failing. In the last CI run, every single test passed in the runner. All of them failed when I ran npx playwright test locally right after pushing the code.
image

name: Playwright Tests
on:
push:
branches: [main, master]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don’t use main.

- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there no playwright github actions?

with:
name: /playwright-action/playwright-report
path: /playwright-action/playwright-report/
retention-days: 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need a bump up.

branches: [main, master]
jobs:
test:
timeout-minutes: 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary and will only inevitably need a bump up.

},

{
name: "firefox",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with Safari

await page.goto("https://playground.meshery.io/extension/meshmap");

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sort of thing is too fragile.

Updated the playwright config to:
 - Capture the screenshot of the test.
 - Record a video of execution of the test.
 - Enabled the headless mode (i.e. playwright will open the browser
   while executing the tests). However, it is not useful for CI
   environments.
 - Updated the timout values for the tests, and the retention period of
   the reports.

Added the test script in package json.

Added the "Login and logout test":
 - It'll visit playground website.
 - Login using the given creds.
 - Click on the hamburger menu on the top-right corner.
 - And log out.

Signed-off-by: VaibhavMalik4187 <[email protected]>
@leecalcote leecalcote merged commit 13414ff into layer5labs:master Sep 11, 2023
1 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants