Merge branch 'develop' into feature/tvmaze-replacement

This commit is contained in:
tidusjar 2021-03-12 23:40:25 +00:00
commit 8368877c74
135 changed files with 10704 additions and 320 deletions

View file

@ -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);
}
}

View 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();

View file

@ -0,0 +1,12 @@
class SearchBar {
constructor() { }
get searchInput(): Cypress.Chainable<any> {
return cy.get(`#nav-search`);
}
}
export const searchBar = new SearchBar();