import { BasePage } from "../../base.page"; import { AdminRequestDialog } from "../../shared/AdminRequestDialog"; class TvRequestPanel { seasonTab(seasonNumber: number): Cypress.Chainable { return cy.getByData("classStatus"+seasonNumber); } getSeasonMasterCheckbox(seasonNumber: number): Cypress.Chainable { return cy.getByData("masterCheckbox"+seasonNumber); } getEpisodeSeasonCheckbox(seasonNumber: number, episodeNumber?: number): Cypress.Chainable { return cy.getByData("episodeCheckbox"+seasonNumber+episodeNumber); } getEpisodeCheckbox(seasonNumber: number): Cypress.Chainable { return cy.getByDataLike("episodeCheckbox"+seasonNumber); } getEpisodeStatus(seasonNumber: number, episodeNumber?: number): Cypress.Chainable { if (episodeNumber) { return cy.getByData('episodeStatus'+seasonNumber+episodeNumber); } return cy.getByDataLike('episodeStatus'+seasonNumber); } } class RequestFabButton { get requestSelected(): Cypress.Chainable { return cy.get('#requestSelected'); } get requestLatest(): Cypress.Chainable { return cy.get('#requestLatest'); } get requestFirst(): Cypress.Chainable { return cy.get('#requestFirst'); } get fab(): Cypress.Chainable { return cy.get('#addFabBtn'); } } class TvDetailsInformationPanel { get status(): Cypress.Chainable { return cy.get('#status'); } getStreaming(streamName: string): Cypress.Chainable { return cy.get(`#stream${streamName}`); } } class TvDetailsPage extends BasePage { get title(): Cypress.Chainable { return cy.get('#mediaTitle'); } get availableButton(): Cypress.Chainable { return cy.get('#availableBtn'); } get requestButton(): Cypress.Chainable { return cy.get('#requestBtn'); } get partiallyAvailableButton(): Cypress.Chainable { return cy.get('#partiallyAvailableBtn'); } get reportIssueButton(): Cypress.Chainable { return cy.get('#reportIssueBtn'); } informationPanel = new TvDetailsInformationPanel(); requestFabButton = new RequestFabButton(); requestPanel = new TvRequestPanel(); adminOptionsDialog = new AdminRequestDialog(); constructor() { super(); } visit(options: Cypress.VisitOptions): Cypress.Chainable; visit(): Cypress.Chainable; visit(id: string): Cypress.Chainable; visit(id: string, options: Cypress.VisitOptions): Cypress.Chainable; visit(id?: any, options?: any) { return cy.visit(`/details/tv/` + id, options); } } export const tvDetailsPage = new TvDetailsPage();