Skip to content

Commit

Permalink
test(playwright): Convert Cypress tests to Playwright - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
xrutayisire committed Dec 20, 2023
1 parent be58247 commit a02690a
Show file tree
Hide file tree
Showing 31 changed files with 948 additions and 645 deletions.
9 changes: 7 additions & 2 deletions .github/actions/restore-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ runs:
path: |
node_modules
*/*/node_modules
~/.cache/Cypress
~/.cache/ms-playwright
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-dependencies
- name: Cache artifacts
id: cache-artifacts
Expand All @@ -21,3 +19,10 @@ runs:
packages/*/dist
packages/core/build
key: ${{ runner.os }}-${{ github.run_id }}-artifacts
- name: Cache playwright binaries
id: cache-playwright-binaries
uses: actions/cache@v3
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-${{ hashFiles('playwright/package.json') }}-playwright-binaries
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@ jobs:
- name: Set up Playwright browsers
run: yarn test:e2e:install

- name: Set up Slice Machine project
run: |
yarn workspaces foreach --include '{@slicemachine/adapter-next,@slicemachine/manager,@slicemachine/plugin-kit,start-slicemachine}' --parallel --topological-dev run build
yarn workspace slice-machine-ui pack --out ../../e2e-projects/next/sm.tgz
yarn workspace cimsirp add -D ./sm.tgz
- name: Running E2E tests
run: yarn test:e2e
env:
PRISMIC_URL: https://wroom.io
WROOM_EMAIL: ${{ secrets.EMAIL }}
WROOM_PASSWORD: ${{ secrets.PASSWORD }}
DEBUG: pw:test

- name: Upload HTML report
uses: actions/upload-artifact@v3
Expand Down
72 changes: 0 additions & 72 deletions cypress/e2e/updates/sidebar.cy.js

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/e2e/updates/simulator-tooltip.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("simulator tooltip", () => {

cy.contains("Simulate your slices").should("exist");

cy.contains("Got It").click();
cy.contains("Got it").click();

cy.contains("Simulate your slices").should("not.exist");

Expand Down
75 changes: 0 additions & 75 deletions cypress/e2e/updates/video-tooltip.cy.js

This file was deleted.

46 changes: 0 additions & 46 deletions cypress/e2e/user-flows/scenario_slice_association.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,50 +78,4 @@ describe.skip("I am an existing SM user (Next) and I want to associate a Slice t
cy.contains("Repeatable Rich Text Field");
cy.contains("Repeatable Key Text Field");
});

it("Push the newly created custom type and slice", () => {
changesPage.goTo().pushChanges().isUpToDate();
});

it.skip("Add the Slice to the Custom Type", () => {
cy.visit(`/custom-types/${customTypeId}`);

cy.get("[data-cy=update-slices]").click();
cy.get(`[data-cy=shared-slice-card-${sliceId}]`).click();
cy.get("[data-cy=update-slices-modal]").submit();

customTypeBuilder.save();

cy.reload();
cy.contains(sliceName);
});

it.skip("Push the custom type with the Slice associated", () => {
changesPage.goTo().pushChanges().isUpToDate();
});

it.skip("Displays and fill the satisfaction survey and the survey never reappears after", () => {
const lastSyncChange = Date.now() - 1000 * 60 * 60 * 2;

// Setting the context to display the survey
cy.setSliceMachineUserContext({
hasSendAReview: false,
lastSyncChange,
});

// Visit a page
cy.visit("/");

cy.get("#review-form");
cy.get("[data-cy=review-form-score-3]").click();
cy.get("[data-cy=review-form-comment]").type(
"Cypress test - testing the comment of the survey",
);
cy.get("#review-form").submit();

cy.reload();
cy.waitUntil(() => cy.get("[data-cy=create-ct]"));

cy.get("#review-form").should("not.exist");
});
});
140 changes: 0 additions & 140 deletions cypress/e2e/user-flows/transactional-push.cy.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const ChangesListItem: FC = () => {
When you click Save, your changes are saved locally. Then, you can push
your models to Prismic from the Changes page.
</HoverCardDescription>
<HoverCardCloseButton>Got It</HoverCardCloseButton>
<HoverCardCloseButton>Got it</HoverCardCloseButton>
</HoverCard>
);
};
Expand Down
Loading

0 comments on commit a02690a

Please sign in to comment.