test: Updated automation tests

pull/4365/head
tidusjar 3 years ago
parent 704252e885
commit b6fa61b33d

@ -23,6 +23,7 @@
// //
// -- This will overwrite an existing command -- // -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
import 'cypress-wait-until'; import 'cypress-wait-until';
Cypress.Commands.add("landingSettings", (enabled) => { Cypress.Commands.add("landingSettings", (enabled) => {
@ -66,7 +67,7 @@ Cypress.Commands.add('removeLogin', () => {
}); });
Cypress.Commands.add('verifyNotification', (text) => { Cypress.Commands.add('verifyNotification', (text) => {
cy.contains(text); cy.contains(text, {timeout: 10000});
}); });
Cypress.Commands.add('createUser', (username, password, claims) => { Cypress.Commands.add('createUser', (username, password, claims) => {

@ -10,7 +10,7 @@ describe("Movie Details Buttons", () => {
Page.adminOptionsDialog.requestButton.click(); 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"); Page.requestedButton.should("be.visible");
}); });
@ -26,7 +26,7 @@ describe("Movie Details Buttons", () => {
Page.visit("651571"); Page.visit("651571");
Page.requestButton.click(); 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"); Page.requestedButton.should("be.visible");
}); });
@ -62,7 +62,7 @@ describe("Movie Details Buttons", () => {
Page.visit("793723"); Page.visit("793723");
Page.requestButton.click(); 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"); Page.requestedButton.should("be.visible");
@ -90,7 +90,7 @@ describe("Movie Details Buttons", () => {
Page.adminOptionsDialog.isOpen(); Page.adminOptionsDialog.isOpen();
Page.adminOptionsDialog.requestButton.click(); Page.adminOptionsDialog.requestButton.click();
cy.verifyNotification( 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(); cy.reload();
@ -98,6 +98,10 @@ describe("Movie Details Buttons", () => {
Page.markAvailableButton.should("exist"); Page.markAvailableButton.should("exist");
Page.markAvailableButton.click(); Page.markAvailableButton.click();
cy.waitUntil(() => {
return Page.availableButton.should("be.visible");
})
cy.verifyNotification("Request is now available"); cy.verifyNotification("Request is now available");
Page.availableButton.should("exist"); Page.availableButton.should("exist");
}); });
@ -111,7 +115,7 @@ describe("Movie Details Buttons", () => {
Page.adminOptionsDialog.isOpen(); Page.adminOptionsDialog.isOpen();
Page.adminOptionsDialog.requestButton.click(); Page.adminOptionsDialog.requestButton.click();
cy.verifyNotification( 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(); cy.reload();

@ -42,7 +42,7 @@ describe("Discover Cards Requests Tests", () => {
Page.adminOptionsDialog.isOpen(); Page.adminOptionsDialog.isOpen();
Page.adminOptionsDialog.requestButton.click(); Page.adminOptionsDialog.requestButton.click();
cy.verifyNotification("has been successfully added!"); cy.verifyNotification("has been added successfully");
card.requestButton.should("not.exist"); card.requestButton.should("not.exist");
card.availabilityText.should("have.text", "Pending"); card.availabilityText.should("have.text", "Pending");
@ -91,7 +91,7 @@ describe("Discover Cards Requests Tests", () => {
card.requestButton.should("be.visible"); card.requestButton.should("be.visible");
card.requestButton.click(); card.requestButton.click();
cy.verifyNotification("has been successfully added!"); cy.verifyNotification("has been added successfully");
card.requestButton.should("not.exist"); card.requestButton.should("not.exist");
card.availabilityText.should("have.text", "Pending"); card.availabilityText.should("have.text", "Pending");

Loading…
Cancel
Save