import { BasePage } from "../base.page"; class MediaBaseTab { get allRequestsButton(): Cypress.Chainable { return cy.get('#filterAll'); } get pendingRequestsButton(): Cypress.Chainable { return cy.get('#filterPending'); } get processingRequestsButton(): Cypress.Chainable { return cy.get('#filterProcessing'); } get availableRequestsButton(): Cypress.Chainable { return cy.get('#filterAvailable'); } get deniedRequestsButton(): Cypress.Chainable { return cy.get('#filterDenied'); } get requestsToDisplayDropdown(): Cypress.Chainable { return cy.get('#requestsToDisplayDropdown'); } getGridRow(requestId: number): GridRow { return new GridRow(requestId); } } class GridRow { requestId: number; get title(): Cypress.Chainable { return cy.get(`#title${this.requestId}`); } get requestedBy(): Cypress.Chainable { return cy.get(`#requestedBy${this.requestId}`); } get requestedDate(): Cypress.Chainable { return cy.get(`#requestedDate${this.requestId}`); } get requestedStatus(): Cypress.Chainable { return cy.get(`#requestedStatus${this.requestId}`); } get status(): Cypress.Chainable { return cy.get(`#status${this.requestId}`); } get detailsButton(): Cypress.Chainable { return cy.get(`#detailsButton${this.requestId}`); } get optionsButton(): Cypress.Chainable { return cy.get(`#optionsButton${this.requestId}`); } get optionsDelete(): Cypress.Chainable { return cy.get(`#requestDelete`); } get optionsApprove(): Cypress.Chainable { return cy.get(`#requestApprove`); } get optionsChangeAvailability(): Cypress.Chainable { return cy.get(`#requestChangeAvailability`); } constructor(requestId: number) { this.requestId = requestId; } } class MoviesTab extends MediaBaseTab { get adminMasterCheckbox(): Cypress.Chainable { return cy.get('#adminMasterCheckbox'); } get bulkFabButton(): Cypress.Chainable { return cy.get('#bulkFab'); } get deleteFabButton(): Cypress.Chainable { return cy.get('#deleteFabButton'); } get approveFabButton(): Cypress.Chainable { return cy.get('#approveFabButton'); } } class RequestsPage extends BasePage { get moviesTab(): Cypress.Chainable { return cy.get('[role="tab"]').eq(0); } get tvTab(): Cypress.Chainable { return cy.get('[role="tab"]').eq(1); } get musicTab(): Cypress.Chainable { return cy.get('[role="tab"]').eq(2); } movies = new MoviesTab(); tv = new MediaBaseTab(); music = new MediaBaseTab(); 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(`/requests-list`, options); } } export const requestPage = new RequestsPage();