mirror of https://github.com/Ombi-app/Ombi
parent
e4ab1447aa
commit
0a804c6233
@ -1,37 +1,80 @@
|
||||
import { BasePage } from "../base.page";
|
||||
|
||||
class DiscoverCard {
|
||||
private id: string;
|
||||
private movie: boolean;
|
||||
constructor(id: string, movie: boolean) {
|
||||
this.id = id;
|
||||
this.movie = movie;
|
||||
}
|
||||
|
||||
get topLevelCard(): Cypress.Chainable<any> {
|
||||
return cy.get(`#result${this.id}`);
|
||||
}
|
||||
|
||||
get requestType(): Cypress.Chainable<any> {
|
||||
return cy.get(`#type${this.id}`);
|
||||
}
|
||||
|
||||
get statusClass(): Cypress.Chainable<any> {
|
||||
return cy.get(`#status${this.id}`);
|
||||
}
|
||||
|
||||
get availabilityText(): Cypress.Chainable<any> {
|
||||
return cy.get(`#availabilityStatus${this.id}`);
|
||||
}
|
||||
|
||||
get title(): Cypress.Chainable<any> {
|
||||
return cy.get(`#title${this.id}`);
|
||||
}
|
||||
|
||||
get overview(): Cypress.Chainable<any> {
|
||||
return cy.get(`#overview${this.id}`);
|
||||
}
|
||||
|
||||
get requestButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`button > [data-test=requestButton${this.id}${this.movie ? '1' : '0'}]`);
|
||||
}
|
||||
|
||||
verifyTitle(expected: string): Cypress.Chainable<any> {
|
||||
return this.title.should('have.text',expected);
|
||||
}
|
||||
}
|
||||
|
||||
class CarouselComponent {
|
||||
private id: string;
|
||||
private type: string;
|
||||
|
||||
get combinedButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`#${this.type}Combined-button`);
|
||||
}
|
||||
|
||||
get combinedButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`#${this.id}Combined-button`);
|
||||
}
|
||||
get movieButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`#${this.type}Movie-button`);
|
||||
}
|
||||
|
||||
get movieButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`#${this.id}Movie-button`);
|
||||
}
|
||||
get tvButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`#${this.type}Tv-button`);
|
||||
}
|
||||
|
||||
get tvButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`#${this.id}Tv-button`);
|
||||
}
|
||||
getCard(id: string, movie: boolean): DiscoverCard {
|
||||
return new DiscoverCard(id, movie);
|
||||
}
|
||||
|
||||
constructor(id: string) {
|
||||
this.id = id;
|
||||
}
|
||||
constructor(id: string) {
|
||||
this.type = id;
|
||||
}
|
||||
}
|
||||
|
||||
class DiscoverPage extends BasePage {
|
||||
popularCarousel = new CarouselComponent("popular");
|
||||
|
||||
popularCarousel = new CarouselComponent('popular');
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
visit(options?: Cypress.VisitOptions): Cypress.Chainable<Cypress.AUTWindow> {
|
||||
return cy.visit(`/discover`, options);
|
||||
}
|
||||
visit(options?: Cypress.VisitOptions): Cypress.Chainable<Cypress.AUTWindow> {
|
||||
return cy.visit(`/discover`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export const discoverPage = new DiscoverPage();
|
||||
|
Loading…
Reference in new issue