mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 18:47:15 -07:00
cleanup
This commit is contained in:
parent
c6c45b3342
commit
2710d7349f
9 changed files with 128 additions and 71 deletions
|
@ -3,3 +3,4 @@ export * from './login/login.page';
|
|||
export * from './wizard/wizard.page';
|
||||
export * from './details/tv/tvdetails.page';
|
||||
export * from './search/search.page';
|
||||
export * from './user-preferences/user-preferences.page';
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
import { BasePage } from "../base.page";
|
||||
|
||||
class UserPreferencesPage extends BasePage {
|
||||
|
||||
get languageSelectBox(): Cypress.Chainable<any> {
|
||||
return cy.get('#langSelect');
|
||||
}
|
||||
|
||||
languageSelectBoxOption(lang: string): Cypress.Chainable<any> {
|
||||
return cy.get('#langSelect'+lang);
|
||||
}
|
||||
|
||||
get streamingSelectBox(): Cypress.Chainable<any> {
|
||||
return cy.get('#streamingSelect');
|
||||
}
|
||||
|
||||
streamingSelectBoxOption(country: string): Cypress.Chainable<any> {
|
||||
return cy.get('#streamingSelect'+country);
|
||||
}
|
||||
|
||||
get qrCode(): Cypress.Chainable<any> {
|
||||
return cy.get('#qrCode');
|
||||
}
|
||||
|
||||
get noQrCode(): Cypress.Chainable<any> {
|
||||
return cy.get('#noQrCode');
|
||||
}
|
||||
|
||||
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(`/user-preferences`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export const userPreferencesPage = new UserPreferencesPage();
|
|
@ -129,7 +129,7 @@ describe("TV Requests Grid", function () {
|
|||
cy.verifyNotification('You need to select some episodes!');
|
||||
});
|
||||
|
||||
it.only("Request single episodes", () => {
|
||||
it("Request single episodes", () => {
|
||||
Page.visit('1399');
|
||||
|
||||
Page.requestPanel.seasonTab(2).click();
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { searchPage as Page } from "@/integration/page-objects";
|
||||
import { verify } from "cypress/types/sinon";
|
||||
|
||||
describe("Search Tests", () => {
|
||||
beforeEach(() => {
|
||||
|
@ -152,4 +151,17 @@ describe("Search Tests", () => {
|
|||
expect(+x).to.be.greaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
it("Searching via the search bar", () => {
|
||||
Page.navbar.searchFilter.applyFilter(true, true, false);
|
||||
Page.visit(" ");
|
||||
|
||||
cy.wait('@searchResponse');
|
||||
|
||||
Page.navbar.searchBar.searchInput.type('007');
|
||||
|
||||
Page.searchResultsContainer.invoke('attr', 'search-count').then((x: string) => {
|
||||
expect(+x).to.be.greaterThan(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
import { userPreferencesPage as Page } from "@/integration/page-objects";
|
||||
|
||||
describe("User Preferences Tests", () => {
|
||||
beforeEach(() => {
|
||||
cy.login();
|
||||
});
|
||||
|
||||
const langs = [
|
||||
{ code: 'fr', discover: 'Découvrir'},
|
||||
{ code: 'de', discover: 'Entdecken'},
|
||||
{ code: 'en', discover: 'Discover'},
|
||||
];
|
||||
|
||||
langs.forEach((l) => {
|
||||
it(`Change language to ${l.code}, UI should update`, () => {
|
||||
cy.intercept('POST','/language').as('langSave');
|
||||
Page.visit();
|
||||
|
||||
Page.languageSelectBox.click();
|
||||
Page.languageSelectBoxOption(l.code).click();
|
||||
|
||||
Page.navbar.discover.contains(l.discover);
|
||||
|
||||
cy.wait('@langSave').then((intercept) => {
|
||||
expect(intercept.request.body.lang).equal(l.code);
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
const streamingCountries = [
|
||||
'GB',
|
||||
'US',
|
||||
'FR',
|
||||
'HU'
|
||||
];
|
||||
|
||||
streamingCountries.forEach((country) => {
|
||||
// derive test name from data
|
||||
it(`Change streaming to ${country} UI should update`, () => {
|
||||
cy.intercept('GET','streamingcountry').as('countryApi');
|
||||
cy.intercept('POST','streamingcountry').as('countryApiSave');
|
||||
Page.visit();
|
||||
cy.wait('@countryApi');
|
||||
|
||||
Page.streamingSelectBox.click();
|
||||
Page.streamingSelectBoxOption(country).click();
|
||||
|
||||
Page.streamingSelectBox.should('have.attr','ng-reflect-value', country);
|
||||
|
||||
cy.wait('@countryApiSave').then((intercept) => {
|
||||
expect(intercept.request.body.code).equal(country);
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue