mirror of
https://github.com/Ombi-app/Ombi.git
synced 2024-11-23 05:50:09 -08:00
ff04d87534
* feat(discover): ✨ Admins can now approve the Recently Requested list * feat(discover): ⚡ Images for the recently requested area are now loading faster and just better all around * test: ✅ Added automation for the new feature
78 lines
1.9 KiB
TypeScript
78 lines
1.9 KiB
TypeScript
import { BasePage } from "../base.page";
|
|
import { AdminRequestDialog } from "../shared/AdminRequestDialog";
|
|
import { DiscoverCard, DiscoverType } from "../shared/DiscoverCard";
|
|
|
|
class CarouselComponent {
|
|
private type: string;
|
|
|
|
get combinedButton(): Cypress.Chainable<any> {
|
|
return cy.get(`#${this.type}Combined-button`);
|
|
}
|
|
|
|
get movieButton(): Cypress.Chainable<any> {
|
|
return cy.get(`#${this.type}Movie-button`);
|
|
}
|
|
|
|
get tvButton(): Cypress.Chainable<any> {
|
|
return cy.get(`#${this.type}Tv-button`);
|
|
}
|
|
|
|
getCard(id: string, movie: boolean, type?: DiscoverType): DiscoverCard {
|
|
return new DiscoverCard(id, movie, type);
|
|
}
|
|
|
|
constructor(id: string) {
|
|
this.type = id;
|
|
}
|
|
}
|
|
|
|
class RecentlyRequestedComponent {
|
|
getRequest(id: string): DetailedCard {
|
|
return new DetailedCard(id);
|
|
}
|
|
}
|
|
|
|
class DetailedCard {
|
|
private id: string;
|
|
|
|
get title(): Cypress.Chainable<any> {
|
|
return cy.get(`#detailed-request-title-${this.id}`);
|
|
}
|
|
|
|
get status(): Cypress.Chainable<any> {
|
|
return cy.get(`#detailed-request-status-${this.id}`);
|
|
}
|
|
|
|
get approveButton(): Cypress.Chainable<any> {
|
|
return cy.get(`#detailed-request-approve-${this.id}`);
|
|
}
|
|
|
|
verifyTitle(expected: string): Cypress.Chainable<any> {
|
|
return this.title.should('have.text',expected);
|
|
}
|
|
|
|
constructor(id: string) {
|
|
this.id = id;
|
|
}
|
|
}
|
|
|
|
class DiscoverPage extends BasePage {
|
|
popularCarousel = new CarouselComponent("popular");
|
|
recentlyRequested = new RecentlyRequestedComponent();
|
|
adminOptionsDialog = new AdminRequestDialog();
|
|
|
|
constructor() {
|
|
super();
|
|
}
|
|
|
|
visit(options: Cypress.VisitOptions): Cypress.Chainable<Cypress.AUTWindow>;
|
|
visit(): Cypress.Chainable<Cypress.AUTWindow>;
|
|
visit(id: string): Cypress.Chainable<Cypress.AUTWindow>;
|
|
visit(id: string, options: Cypress.VisitOptions): Cypress.Chainable<Cypress.AUTWindow>;
|
|
visit(id?: any, options?: any) {
|
|
return cy.visit(`/discover`, options);
|
|
}
|
|
}
|
|
|
|
export const discoverPage = new DiscoverPage();
|