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

Migrating from Cypress to playwright - Phase 1 #1460

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

hxrshxz
Copy link

@hxrshxz hxrshxz commented Jan 28, 2025

#1436

Setting up

  • Add and Configure playwright.config.js for testing

Migrated Test Files

  • home.cy.js
  • login.cy.js
  • globalMenuConfig.cy.js
  • labNumberManagement.cy.js
  • patientEntry.cy.js
  • result.cy.js
  • batchOrderEntry.cy.js
  • dashboard.cy.js
  • modifyOrder.cy.js
  • nonConform.cy.js
  • orderEntity.cy.js
  • report.cy.js
  • validation.cy.js
  • workplan.cy.js

Migrated Pages

  • LoginPage.js
  • AdminPage.js
  • LabNumberManagementPage.js
  • GlobalMenuConfigPage.js
  • PatientEntryPage.js
  • ResultsPage.js
  • BatchOrderEntryPage.js
  • DashBoard.js
  • HomePage.js ( partially done / inProgress)
  • ModifyOrderPage.js
  • NonConformPage.js
  • OrderEntityPage.js
  • RoutineReportPage.js
  • StudyReportPage.js
  • Validation.js
  • WorkPlan.js

@hxrshxz
Copy link
Author

hxrshxz commented Jan 30, 2025

I have successfully migrated 22 tests so far, and as you can see in the video below, all of them are working correctly.-->

Screen.Recording.2025-01-30.140954.mp4

@mozzy11
Copy link
Collaborator

mozzy11 commented Jan 30, 2025

Thanks @hxrshxz for this wornderful work

@mozzy11
Copy link
Collaborator

mozzy11 commented Jan 30, 2025

Let me know when you have some ready tests and i add a CI job for them

@hxrshxz
Copy link
Author

hxrshxz commented Jan 30, 2025

Thanks @hxrshxz for this wornderful work

your welcome

@hxrshxz
Copy link
Author

hxrshxz commented Jan 30, 2025

Let me know when you have some ready tests and i add a CI job for them

sure i will let you know

@hxrshxz
Copy link
Author

hxrshxz commented Jan 30, 2025

@mozzy11 I was thinking would it be a good idea to add some snapshot tests as well? For example, in this case where we extract text from the table to check if orders are present, we could use a snapshot test to verify the same thing and better. What do you think

CYPRESS -->
 it("All known orders are present", () => {
    cy.fixture("Order").then((options) => {
      workplan
        .getWorkPlanResultsTable()
        .find("tr")
        .then((row) => {
          expect(row.text()).contains(options.labNo);
        });
    });
  });

PLAYWRIGHT -->
 const table = await workplanPage.page.getByLabel("example-label");
expect(table).toMatchSnapshot('table-image.png');

I would add them wherever necessary . do let me know what do you think?

@hxrshxz
Copy link
Author

hxrshxz commented Feb 2, 2025

55 Tests migrated So far --->

Screen.Recording.2025-02-03.043228.mp4

@hxrshxz hxrshxz changed the title Migrating from Cypress to playwright Migrating from Cypress to playwright - Phase 1 Feb 3, 2025
@hxrshxz
Copy link
Author

hxrshxz commented Feb 3, 2025

Let me know when you have some ready tests and i add a CI job for them

@mozzy11 @Bahati308 Could you please review and merge this? I will then open another follow up pull request to migrate the remaining files to avoid conflicts.

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