layer5labs / meshmap-snapshot

Infrastructure as Diagram delivered to your pull requests.
https://layer5.io/cloud-native-management/gitops
Apache License 2.0
22 stars 14 forks source link

Playwright test #51

Closed Philip-21 closed 8 months ago

Philip-21 commented 9 months ago

Notes for Reviewers

This PR fixes #

VaibhavMalik4187 commented 9 months ago

Awesome work @Philip-21. Please rebase your branch on master so that you don't re-add the files already present in master.

VaibhavMalik4187 commented 9 months ago

On a side note, adding a slightly more descriptive commit message and description is always helpful for fellow developers :) https://cbea.ms/git-commit/

Philip-21 commented 9 months ago

On a side note, adding a slightly more descriptive commit message and description is always helpful for fellow developers :) https://cbea.ms/git-commit/

Sure, the next commit will have it.

Philip-21 commented 9 months ago

@VaibhavMalik4187 i created new functions in the playwrightSetup file to be called in the playwright test file There are several commands implemented in cypres which cant be done in playwright. looking at this file I can implement login, Setting Viewport, making api request and intercepting requests to be used for testcases.

VaibhavMalik4187 commented 9 months ago

@VaibhavMalik4187 i created new functions in the playwrightSetup file to be called in the playwright test file There are several commands implemented in cypres which cant be done in playwright. looking at this file I can implement login, Setting Viewport, making api request and intercepting requests to be used for testcases.

@Philip-21 you're making great progress. If you could just implement the helper functions used in beforeEachCallbackForCustomUrl, then I'll quickly raise a PR to replace cypress with playwright in meshmap-snapshot action to run the loadDesign e2e test.

Ultimately, this request includes the implementation playwright version of the following cypress functions:

  1. intercept
  2. setViewPort
  3. login

I'll need to spend some more time with playwright before I become able to convert the following functions.

  1. setReleaseTag
  2. interceptCapabilities
  3. setMode

Feel free to ping me in case you need help with anything.

Philip-21 commented 9 months ago

@VaibhavMalik4187 i created new functions in the playwrightSetup file to be called in the playwright test file There are several commands implemented in cypres which cant be done in playwright. looking at this file I can implement login, Setting Viewport, making api request and intercepting requests to be used for testcases.

@Philip-21 you're making great progress. If you could just implement the helper functions used in beforeEachCallbackForCustomUrl, then I'll quickly raise a PR to replace cypress with playwright in meshmap-snapshot action to run the loadDesign e2e test.

Ultimately, this request includes the implementation playwright version of the following cypress functions:

  1. intercept
  2. setViewPort
  3. login

I'll need to spend some more time with playwright before I become able to convert the following functions.

  1. setReleaseTag
  2. interceptCapabilities
  3. setMode

Feel free to ping me in case you need help with anything.

Alright @VaibhavMalik4187 thanks , i'll be intouch

Philip-21 commented 9 months ago

@VaibhavMalik4187 i just implemented some new functions to be used for beforeEachCallbackForCustomUrl

Philip-21 commented 9 months ago

I have been able to write and run some individual tests in the playWrightUtils.js these are just tests in accessing the meshery page and they ran successfully .

meshmaptest1

The main thing is to configure meshmap snapshots to run successfully, I am figuring out how i will configure and put things together to make it a success

I looked through the cypress-action files to see how that was achieved, I observed cypress has alot of inbuilt functionalities which playwright doesn't.

So, I imitated some cypress commands in the commands.js and helpers.js and I defined some of these comands in the playwrightsetup.JS

The constant.js which is similar to the cypress action folder , is for getting the meshmap designs and its api endpoints.

these are just the progress i have made so far

The approach used to run the cypress action, I feel it was a different approach as spec.js file wasn't used to run it. The function in the loadDesign.js runs the e2e tests as we can see in the action workflow. These are just my observations so far

I defined some setup functions that would used to run the e2e test as the way it was implemented for the cypress-action.

But I feel using the spec.js will be better for running e2e tests for playwright, as i was able to run individual tests successfully in the spec file . I am also figuring out how to call and perform the meshMap snapshot actions with configurations in the playwrightsetup.js and the design endpoint in the constant.js which will be called and ran in the spec file

Philip-21 commented 9 months ago

@MarioArriaga92 thanks i've fixed them

hamza-mohd commented 9 months ago

This is some inspiring work, @Philip-21 😄

Philip-21 commented 9 months ago

This is some inspiring work, @Philip-21 😄

lol thanks

MarioArriaga92 commented 9 months ago

@Philip-21 any idea why all the PR Check failures?

CleanShot 2023-09-28 at 10 56 35@2x
MarioArriaga92 commented 9 months ago

@Philip-21 also, about the "tests_e2e" job, 2 questions/observations:

  1. Is there a way to make "Run Playwright tests" step a bit more verbose so titles of passing tests are shown?
  2. seems like upload-artifact action/step isn't finding any files to upload.

See screenshot for reference:

CleanShot 2023-09-28 at 10 58 21@2x
hamza-mohd commented 9 months ago

This is quite interesting, @Philip-21. Cool.

Abhishek-kumar09 commented 8 months ago

Hello @Philip-21 The workflow is pull_request_target, it only runs on master branch, so its obvious to fail here. Your local changes are running good?

You can merge your branch into your local fork and see the running tests/debug from there.

leecalcote commented 8 months ago

Does it work?

Philip-21 commented 8 months ago

All Playwright tests work perfectly, but the workflow is still detecting failed cypress actions. I am liaising with Abhi on this issue

On Wed, Oct 18, 2023 at 6:26 PM Lee Calcote @.***> wrote:

Does it work?

— Reply to this email directly, view it on GitHub https://github.com/layer5labs/meshmap-snapshot/pull/51#issuecomment-1769009191, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARP2QJWIUJRXCGB7GCFDABLYAAGLTAVCNFSM6AAAAAA4SNZOSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRZGAYDSMJZGE . You are receiving this because you modified the open/close state.Message ID: @.***>