mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 18:47:15 -07:00
Fixed all the automation tests, and the bugs that the tests found
This commit is contained in:
parent
c5f123b903
commit
e34ce215ac
13 changed files with 112 additions and 21 deletions
|
@ -1,10 +1,15 @@
|
|||
import { BasePage } from "../../base.page";
|
||||
import { AdminRequestDialog } from "../../shared/AdminRequestDialog";
|
||||
|
||||
class MovieInformationPanel {
|
||||
|
||||
get denyReason(): Cypress.Chainable<any> {
|
||||
return cy.get('#deniedReasonInfo');
|
||||
}
|
||||
|
||||
get requestedBy(): Cypress.Chainable<any> {
|
||||
return cy.get('#requestedByInfo');
|
||||
}
|
||||
}
|
||||
|
||||
class DenyModal {
|
||||
|
@ -74,6 +79,7 @@ class MovieDetailsPage extends BasePage {
|
|||
|
||||
denyModal = new DenyModal();
|
||||
informationPanel = new MovieInformationPanel();
|
||||
adminOptionsDialog = new AdminRequestDialog();
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
|
||||
export class AdminRequestDialog {
|
||||
|
||||
isOpen(): Cypress.Chainable<any> {
|
||||
return cy.waitUntil(x => {
|
||||
return this.title.should('exist');
|
||||
});
|
||||
}
|
||||
|
||||
get title(): Cypress.Chainable<any> {
|
||||
return cy.get(`#advancedOptionsTitle`);
|
||||
}
|
||||
|
||||
get requestOnBehalfUserInput(): Cypress.Chainable<any> {
|
||||
return cy.get(`#requestOnBehalfUserInput`);
|
||||
}
|
||||
|
||||
get sonarrQualitySelect(): Cypress.Chainable<any> {
|
||||
return cy.get(`#sonarrQualitySelect`);
|
||||
}
|
||||
|
||||
selectSonarrQuality(id: number): Cypress.Chainable<any> {
|
||||
return cy.get(`#sonarrQualitySelect${id}`);
|
||||
}
|
||||
|
||||
get sonarrFolderSelect(): Cypress.Chainable<any> {
|
||||
return cy.get(`#sonarrFolderSelect`);
|
||||
}
|
||||
|
||||
selectSonarrFolder(id: number): Cypress.Chainable<any> {
|
||||
return cy.get(`#sonarrFolderSelect${id}`);
|
||||
}
|
||||
|
||||
get radarrQualitySelect(): Cypress.Chainable<any> {
|
||||
return cy.get(`#radarrQualitySelect`);
|
||||
}
|
||||
|
||||
selectradarrQuality(id: number): Cypress.Chainable<any> {
|
||||
return cy.get(`#radarrQualitySelect${id}`);
|
||||
}
|
||||
|
||||
get radarrFolderSelect(): Cypress.Chainable<any> {
|
||||
return cy.get(`#radarrFolderSelect`);
|
||||
}
|
||||
|
||||
selectradarrFolder(id: number): Cypress.Chainable<any> {
|
||||
return cy.get(`#radarrFolderSelect${id}`);
|
||||
}
|
||||
|
||||
|
||||
get cancelButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`#cancelButton`);
|
||||
}
|
||||
|
||||
get requestButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`#requestButton`);
|
||||
}
|
||||
}
|
|
@ -6,6 +6,10 @@ describe("Movie Details Buttons", () => {
|
|||
|
||||
Page.visit("587807");
|
||||
Page.requestButton.click();
|
||||
Page.adminOptionsDialog.isOpen();
|
||||
|
||||
Page.adminOptionsDialog.requestButton.click();
|
||||
|
||||
cy.verifyNotification("Tom & Jerry (2021) has been successfully added");
|
||||
|
||||
Page.requestedButton.should("be.visible");
|
||||
|
@ -83,6 +87,8 @@ describe("Movie Details Buttons", () => {
|
|||
Page.visit("399566");
|
||||
|
||||
Page.requestButton.click();
|
||||
Page.adminOptionsDialog.isOpen();
|
||||
Page.adminOptionsDialog.requestButton.click();
|
||||
cy.verifyNotification(
|
||||
"Godzilla vs. Kong (2021) has been successfully added"
|
||||
);
|
||||
|
@ -96,12 +102,14 @@ describe("Movie Details Buttons", () => {
|
|||
Page.availableButton.should("exist");
|
||||
});
|
||||
|
||||
it("Movie Requested, Deny Movie", () => {
|
||||
it.only("Movie Requested, Deny Movie", () => {
|
||||
cy.login();
|
||||
|
||||
Page.visit("671");
|
||||
|
||||
Page.requestButton.click();
|
||||
Page.adminOptionsDialog.isOpen();
|
||||
Page.adminOptionsDialog.requestButton.click();
|
||||
cy.verifyNotification(
|
||||
"Harry Potter and the Philosopher's Stone (2001) has been successfully added"
|
||||
);
|
||||
|
@ -112,6 +120,7 @@ describe("Movie Details Buttons", () => {
|
|||
Page.denyButton.click();
|
||||
|
||||
Page.denyModal.denyReason.type("Automation Tests");
|
||||
cy.wait(500);
|
||||
Page.denyModal.denyButton.click();
|
||||
|
||||
Page.deniedButton.should('exist');
|
||||
|
|
|
@ -173,7 +173,7 @@ describe("Discover Cards Requests Tests", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it.only("Not available TV does not allow us to request", () => {
|
||||
it("Not available TV does not allow us to request", () => {
|
||||
cy.intercept("GET", "**/search/Tv/popular/**", (req) => {
|
||||
req.reply((res) => {
|
||||
const body = res.body;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue