Skip to content

Commit

Permalink
test: ✅ Updated automation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar committed Oct 20, 2021
1 parent 704252e commit b6fa61b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion tests/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

import 'cypress-wait-until';

Cypress.Commands.add("landingSettings", (enabled) => {
Expand Down Expand Up @@ -66,7 +67,7 @@ Cypress.Commands.add('removeLogin', () => {
});

Cypress.Commands.add('verifyNotification', (text) => {
cy.contains(text);
cy.contains(text, {timeout: 10000});
});

Cypress.Commands.add('createUser', (username, password, claims) => {
Expand Down
14 changes: 9 additions & 5 deletions tests/cypress/tests/details/movie/moviedetails-buttons.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Movie Details Buttons", () => {

Page.adminOptionsDialog.requestButton.click();

cy.verifyNotification("Tom & Jerry (2021) has been successfully added");
cy.verifyNotification("Request for Tom & Jerry has been added successfully");

Page.requestedButton.should("be.visible");
});
Expand All @@ -26,7 +26,7 @@ describe("Movie Details Buttons", () => {
Page.visit("651571");

Page.requestButton.click();
cy.verifyNotification("Breach (2020) has been successfully added");
cy.verifyNotification("Request for Breach has been added successfully");

Page.requestedButton.should("be.visible");
});
Expand Down Expand Up @@ -62,7 +62,7 @@ describe("Movie Details Buttons", () => {
Page.visit("793723");

Page.requestButton.click();
cy.verifyNotification("Sentinelle (2021) has been successfully added");
cy.verifyNotification("Request for Sentinelle has been added successfully");

Page.requestedButton.should("be.visible");

Expand Down Expand Up @@ -90,14 +90,18 @@ describe("Movie Details Buttons", () => {
Page.adminOptionsDialog.isOpen();
Page.adminOptionsDialog.requestButton.click();
cy.verifyNotification(
"Harry Potter and the Deathly Hallows: Part 1 (2010) has been successfully added"
"Request for Harry Potter and the Deathly Hallows: Part 1 has been added successfully"
);

cy.reload();

Page.markAvailableButton.should("exist");
Page.markAvailableButton.click();

cy.waitUntil(() => {
return Page.availableButton.should("be.visible");
})

cy.verifyNotification("Request is now available");
Page.availableButton.should("exist");
});
Expand All @@ -111,7 +115,7 @@ describe("Movie Details Buttons", () => {
Page.adminOptionsDialog.isOpen();
Page.adminOptionsDialog.requestButton.click();
cy.verifyNotification(
"Harry Potter and the Philosopher's Stone (2001) has been successfully added"
"Request for Harry Potter and the Philosopher's Stone has been added successfully"
);

cy.reload();
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/tests/discover/discover-cards-requests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("Discover Cards Requests Tests", () => {
Page.adminOptionsDialog.isOpen();
Page.adminOptionsDialog.requestButton.click();

cy.verifyNotification("has been successfully added!");
cy.verifyNotification("has been added successfully");

card.requestButton.should("not.exist");
card.availabilityText.should("have.text", "Pending");
Expand Down Expand Up @@ -91,7 +91,7 @@ describe("Discover Cards Requests Tests", () => {
card.requestButton.should("be.visible");
card.requestButton.click();

cy.verifyNotification("has been successfully added!");
cy.verifyNotification("has been added successfully");

card.requestButton.should("not.exist");
card.availabilityText.should("have.text", "Pending");
Expand Down

0 comments on commit b6fa61b

Please sign in to comment.