mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Merge branch 'develop' into feature/tvmaze-replacement
This commit is contained in:
commit
8368877c74
135 changed files with 10704 additions and 320 deletions
10
tests/cypress/integration/page-objects/base.page.ts
Normal file
10
tests/cypress/integration/page-objects/base.page.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
|
||||
import { navBar as NavBar } from './shared/NavBar';
|
||||
export abstract class BasePage {
|
||||
abstract visit(options: Cypress.VisitOptions): Cypress.Chainable<Cypress.AUTWindow>;
|
||||
abstract visit(): Cypress.Chainable<Cypress.AUTWindow>;
|
||||
abstract visit(id: string): Cypress.Chainable<Cypress.AUTWindow>;
|
||||
abstract visit(id: string, options: Cypress.VisitOptions): Cypress.Chainable<Cypress.AUTWindow>;
|
||||
|
||||
navbar = NavBar;
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
import { BasePage } from "../../base.page";
|
||||
|
||||
class TvRequestPanel {
|
||||
|
||||
seasonTab(seasonNumber: number): Cypress.Chainable<any> {
|
||||
return cy.getByData("classStatus"+seasonNumber);
|
||||
}
|
||||
|
||||
getSeasonMasterCheckbox(seasonNumber: number): Cypress.Chainable<any> {
|
||||
return cy.getByData("masterCheckbox"+seasonNumber);
|
||||
}
|
||||
|
||||
getEpisodeSeasonCheckbox(seasonNumber: number, episodeNumber?: number): Cypress.Chainable<any> {
|
||||
return cy.getByData("episodeCheckbox"+seasonNumber+episodeNumber);
|
||||
}
|
||||
|
||||
getEpisodeCheckbox(seasonNumber: number): Cypress.Chainable<any> {
|
||||
return cy.getByDataLike("episodeCheckbox"+seasonNumber);
|
||||
}
|
||||
|
||||
getEpisodeStatus(seasonNumber: number, episodeNumber?: number): Cypress.Chainable<any> {
|
||||
if (episodeNumber) {
|
||||
return cy.getByData('episodeStatus'+seasonNumber+episodeNumber);
|
||||
}
|
||||
return cy.getByDataLike('episodeStatus'+seasonNumber);
|
||||
}
|
||||
}
|
||||
|
||||
class RequestFabButton {
|
||||
|
||||
get requestSelected(): Cypress.Chainable<any> {
|
||||
return cy.get('#requestSelected');
|
||||
}
|
||||
|
||||
get requestLatest(): Cypress.Chainable<any> {
|
||||
return cy.get('#requestLatest');
|
||||
}
|
||||
|
||||
get requestFirst(): Cypress.Chainable<any> {
|
||||
return cy.get('#requestFirst');
|
||||
}
|
||||
|
||||
get fab(): Cypress.Chainable<any> {
|
||||
return cy.get('#addFabBtn');
|
||||
}
|
||||
}
|
||||
|
||||
class TvDetailsInformationPanel {
|
||||
|
||||
get status(): Cypress.Chainable<any> {
|
||||
return cy.get('#status');
|
||||
}
|
||||
|
||||
getStreaming(streamName: string): Cypress.Chainable<any> {
|
||||
return cy.get(`#stream${streamName}`);
|
||||
}
|
||||
}
|
||||
|
||||
class TvDetailsPage extends BasePage {
|
||||
|
||||
|
||||
get availableButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#availableBtn');
|
||||
}
|
||||
|
||||
get requestButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#requestBtn');
|
||||
}
|
||||
|
||||
get partiallyAvailableButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#partiallyAvailableBtn');
|
||||
}
|
||||
|
||||
get reportIssueButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#reportIssueBtn');
|
||||
}
|
||||
|
||||
|
||||
informationPanel = new TvDetailsInformationPanel();
|
||||
requestFabButton = new RequestFabButton();
|
||||
requestPanel = new TvRequestPanel();
|
||||
|
||||
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(`/details/tv/` + id, options);
|
||||
}
|
||||
}
|
||||
|
||||
export const tvDetailsPage = new TvDetailsPage();
|
|
@ -0,0 +1,43 @@
|
|||
import { BasePage } from "../base.page";
|
||||
|
||||
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): DiscoverCard {
|
||||
return new DiscoverCard(id, movie);
|
||||
}
|
||||
|
||||
constructor(id: string) {
|
||||
this.type = id;
|
||||
}
|
||||
}
|
||||
|
||||
class DiscoverPage extends BasePage {
|
||||
popularCarousel = new CarouselComponent("popular");
|
||||
|
||||
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();
|
5
tests/cypress/integration/page-objects/index.ts
Normal file
5
tests/cypress/integration/page-objects/index.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
export * from './discover/discover.page';
|
||||
export * from './login/login.page';
|
||||
export * from './wizard/wizard.page';
|
||||
export * from './details/tv/tvdetails.page';
|
||||
export * from './search/search.page';
|
36
tests/cypress/integration/page-objects/login/login.page.ts
Normal file
36
tests/cypress/integration/page-objects/login/login.page.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { BasePage } from "../base.page";
|
||||
|
||||
class LoginPage extends BasePage {
|
||||
|
||||
|
||||
get username(): Cypress.Chainable<any> {
|
||||
return cy.get('#username-field');
|
||||
}
|
||||
|
||||
get password(): Cypress.Chainable<any> {
|
||||
return cy.get('#password-field');
|
||||
}
|
||||
|
||||
get ombiSignInButton(): Cypress.Chainable<any> {
|
||||
return cy.get('[data-cy=OmbiButton]');
|
||||
}
|
||||
|
||||
get plexSignInButton(): Cypress.Chainable<any> {
|
||||
return cy.get('[data-cy=oAuthPlexButton]');
|
||||
}
|
||||
|
||||
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(`/login`, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const loginPage = new LoginPage();
|
35
tests/cypress/integration/page-objects/search/search.page.ts
Normal file
35
tests/cypress/integration/page-objects/search/search.page.ts
Normal file
|
@ -0,0 +1,35 @@
|
|||
import { BasePage } from "../base.page";
|
||||
import { DiscoverCard } from "../shared/DiscoverCard";
|
||||
|
||||
class SearchPage extends BasePage {
|
||||
|
||||
get noSearchResultMessage(): Cypress.Chainable<any> {
|
||||
return cy.get('#noSearchResult');
|
||||
}
|
||||
|
||||
get searchResultsContainer(): Cypress.Chainable<any> {
|
||||
return cy.get('#searchResults');
|
||||
}
|
||||
|
||||
get searchResultCount(): Cypress.Chainable<any> {
|
||||
return cy.get('[search-count*=]');
|
||||
}
|
||||
|
||||
getCard(id: string, movie: boolean): DiscoverCard {
|
||||
return new DiscoverCard(id, movie);
|
||||
}
|
||||
|
||||
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/` + encodeURI(id), options);
|
||||
}
|
||||
}
|
||||
|
||||
export const searchPage = new SearchPage();
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
export 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(`#requestButton${this.id}${this.movie ? '1' : '0'}`);
|
||||
}
|
||||
|
||||
verifyTitle(expected: string): Cypress.Chainable<any> {
|
||||
return this.title.should('have.text',expected);
|
||||
}
|
||||
}
|
90
tests/cypress/integration/page-objects/shared/NavBar.ts
Normal file
90
tests/cypress/integration/page-objects/shared/NavBar.ts
Normal file
|
@ -0,0 +1,90 @@
|
|||
import { searchBar as SearchBar } from './SearchBar';
|
||||
|
||||
class SearchFilter {
|
||||
|
||||
constructor() { }
|
||||
|
||||
get filterButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#search-filter');
|
||||
}
|
||||
|
||||
get moviesToggle(): Cypress.Chainable<any> {
|
||||
return cy.get('#filterMovies');
|
||||
}
|
||||
|
||||
get tvToggle(): Cypress.Chainable<any> {
|
||||
return cy.get('#filterTv');
|
||||
}
|
||||
|
||||
get musicToggle(): Cypress.Chainable<any> {
|
||||
return cy.get('#filterMusic');
|
||||
}
|
||||
|
||||
applyFilter(tv: boolean, movies: boolean, music: boolean): void {
|
||||
window.localStorage.removeItem('searchFilter');
|
||||
window.localStorage.setItem('searchFilter', JSON.stringify({ movies: movies, music: music, tvShows: tv}));
|
||||
}
|
||||
}
|
||||
|
||||
class NavBar {
|
||||
|
||||
get profileImage(): Cypress.Chainable<any> {
|
||||
return cy.get('#profile-image');
|
||||
}
|
||||
|
||||
get profileUsername(): Cypress.Chainable<any> {
|
||||
return cy.get('#profile-username');
|
||||
}
|
||||
|
||||
get applicationName(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-applicationName');
|
||||
}
|
||||
|
||||
get discover(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-discover');
|
||||
}
|
||||
|
||||
get requests(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-requests');
|
||||
}
|
||||
|
||||
get issues(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-issues');
|
||||
}
|
||||
|
||||
get userManagement(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-userManagement');
|
||||
}
|
||||
|
||||
get adminDonate(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-adminDonate');
|
||||
}
|
||||
|
||||
get userDonate(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-userDonate');
|
||||
}
|
||||
|
||||
get featureSuggestion(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-featureSuggestion');
|
||||
}
|
||||
|
||||
get settings(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-settings');
|
||||
}
|
||||
|
||||
get userPreferences(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-userPreferences');
|
||||
}
|
||||
|
||||
get logout(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-logout');
|
||||
}
|
||||
|
||||
|
||||
constructor() { }
|
||||
|
||||
searchBar = SearchBar;
|
||||
searchFilter = new SearchFilter();
|
||||
}
|
||||
|
||||
export const navBar = new NavBar();
|
12
tests/cypress/integration/page-objects/shared/SearchBar.ts
Normal file
12
tests/cypress/integration/page-objects/shared/SearchBar.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
class SearchBar {
|
||||
|
||||
constructor() { }
|
||||
|
||||
get searchInput(): Cypress.Chainable<any> {
|
||||
return cy.get(`#nav-search`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const searchBar = new SearchBar();
|
68
tests/cypress/integration/page-objects/wizard/wizard.page.ts
Normal file
68
tests/cypress/integration/page-objects/wizard/wizard.page.ts
Normal file
|
@ -0,0 +1,68 @@
|
|||
import { BasePage } from "../base.page";
|
||||
|
||||
class LocalUserTab {
|
||||
get username(): Cypress.Chainable<any> {
|
||||
return cy.get('#adminUsername');
|
||||
}
|
||||
|
||||
get password(): Cypress.Chainable<any> {
|
||||
return cy.get('#adminPassword');
|
||||
}
|
||||
|
||||
get next(): Cypress.Chainable<any> {
|
||||
return cy.getByData('nextLocalUser');
|
||||
}
|
||||
}
|
||||
|
||||
class WelcomeTab {
|
||||
get next(): Cypress.Chainable<any> {
|
||||
return cy.getByData('nextWelcome');
|
||||
}
|
||||
}
|
||||
|
||||
class MediaServerTab {
|
||||
get next(): Cypress.Chainable<any> {
|
||||
return cy.getByData('nextMediaServer');
|
||||
}
|
||||
}
|
||||
|
||||
class OmbiConfigTab {
|
||||
get next(): Cypress.Chainable<any> {
|
||||
return cy.getByData('nextOmbiConfig');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class WizardPage extends BasePage {
|
||||
|
||||
localUserTab: LocalUserTab;
|
||||
welcomeTab: WelcomeTab;
|
||||
mediaServerTab: MediaServerTab;
|
||||
ombiConfigTab: OmbiConfigTab;
|
||||
|
||||
get finishButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#finishWizard');
|
||||
}
|
||||
|
||||
get matStepsHeader(): Cypress.Chainable<any> {
|
||||
return cy.get('mat-step-header');
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.localUserTab = new LocalUserTab();
|
||||
this.welcomeTab = new WelcomeTab();
|
||||
this.mediaServerTab = new MediaServerTab();
|
||||
this.ombiConfigTab = new OmbiConfigTab();
|
||||
}
|
||||
|
||||
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(`/`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export const wizardPage = new WizardPage();
|
Loading…
Add table
Add a link
Reference in a new issue