import { BasePage } from "../../base.page"; class PlexCredentials { get username(): Cypress.Chainable { return cy.get('#username'); } get password(): Cypress.Chainable { return cy.get('#password'); } get loadServers(): Cypress.Chainable { return cy.get('#loadServers'); } get serverDropdown(): Cypress.Chainable { return cy.get('#servers'); } } class PlexServerModal { get serverName(): Cypress.Chainable { return cy.get('#serverName'); } get hostName(): Cypress.Chainable { return cy.get('#ip'); } get port(): Cypress.Chainable { return cy.get('#port'); } get ssl(): Cypress.Chainable { return cy.get('#ssl'); } get authToken(): Cypress.Chainable { return cy.get('#authToken'); } get machineIdentifier(): Cypress.Chainable { return cy.get('#machineId'); } get externalHostname(): Cypress.Chainable { return cy.get('#externalHostname'); } get batchSize(): Cypress.Chainable { return cy.get('#batchSize'); } get loadLibraries(): Cypress.Chainable { return cy.get('#loadLibs'); } get testButton(): Cypress.Chainable { return cy.get('#testPlexButton'); } get deleteButton(): Cypress.Chainable { return cy.get('#deleteServer'); } get cancelButton(): Cypress.Chainable { return cy.get('#cancel'); } get saveButton(): Cypress.Chainable { return cy.get('#saveServer'); } getLib(index: number): Cypress.Chainable { return cy.get(`#lib-${index}`); } } class PlexServersGrid { serverCardButton(name: string): Cypress.Chainable { return cy.get(`#${name}-button`); } get newServerButton(): Cypress.Chainable { return cy.get('#newServer'); } } class PlexSettingsPage extends BasePage { get enableCheckbox(): Cypress.Chainable { return cy.get('#enable'); } get enableWatchlist(): Cypress.Chainable { return cy.get('#enableWatchlistImport'); } get submit(): Cypress.Chainable { return cy.get('#save'); } get fullySync(): Cypress.Chainable { return cy.get('#fullSync'); } get partialSync(): Cypress.Chainable { return cy.get('#recentlyAddedSync'); } get clearAndResync(): Cypress.Chainable { return cy.get('#clearData'); } get runWatchlist(): Cypress.Chainable { return cy.get('#watchlistImport'); } plexCredentials = new PlexCredentials(); plexServerModal = new PlexServerModal(); plexServerGrid = new PlexServersGrid(); 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(`/Settings/Plex`, options); } } export const plexSettingsPage = new PlexSettingsPage();