This commit is contained in:
tidusjar 2022-12-05 09:15:16 +00:00
parent 80e0bbf312
commit db50e330b4
7 changed files with 24 additions and 19 deletions

View file

@ -75,8 +75,8 @@ class TvDetailsPage extends BasePage {
return cy.get('#partiallyAvailableBtn'); return cy.get('#partiallyAvailableBtn');
} }
get reportIssueButton(): Cypress.Chainable<any> { reportIssueButton(timeout: number): Cypress.Chainable<any> {
return cy.get('#reportIssueBtn'); return cy.get('#reportIssueBtn', { timeout: timeout});
} }

View file

@ -67,13 +67,13 @@ describe("TV Details Buttons", () => {
}); });
it("Issues Enabled", () => { it.only("Issues Enabled", () => {
cy.intercept("GET", "**/Settings/issuesenabled", 'true').as('issuesEnabled'); cy.intercept("GET", "**/Settings/issuesenabled", 'true').as('issuesEnabled');
cy.visit("/details/tv/1399"); cy.visit("/details/tv/1399");
cy.wait('@issuesEnabled'); cy.wait('@issuesEnabled');
Page.reportIssueButton.should('be.visible'); Page.reportIssueButton(10000).should('be.visible');
}); });
it("Issues Disabled", () => { it("Issues Disabled", () => {
@ -81,6 +81,6 @@ describe("TV Details Buttons", () => {
Page.visit("1399"); Page.visit("1399");
Page.reportIssueButton.should('not.exist'); Page.reportIssueButton(1000).should('not.exist');
}); });
}); });

View file

@ -17,6 +17,7 @@ describe("Discover Cards Requests Tests", () => {
movie.requested = false; movie.requested = false;
body[0] = movie; body[0] = movie;
console.log('sending res')
res.send(body); res.send(body);
}); });
}).as("cardsResponse"); }).as("cardsResponse");
@ -24,7 +25,7 @@ describe("Discover Cards Requests Tests", () => {
Page.visit(); Page.visit();
cy.wait("@cardsResponse").then((res) => { cy.wait("@cardsResponse").then((res) => {
const body = JSON.parse(res.response.body); const body = res.response.body;
var expectedId = body[0].id; var expectedId = body[0].id;
var title = body[0].title; var title = body[0].title;
@ -76,7 +77,7 @@ describe("Discover Cards Requests Tests", () => {
Page.visit(); Page.visit();
cy.wait("@cardsResponse").then((res) => { cy.wait("@cardsResponse").then((res) => {
const body = JSON.parse(res.response.body); const body = res.response.body
var expectedId = body[6].id; var expectedId = body[6].id;
var title = body[6].title; var title = body[6].title;
@ -119,7 +120,7 @@ describe("Discover Cards Requests Tests", () => {
Page.visit(); Page.visit();
cy.wait("@cardsResponse").then((res) => { cy.wait("@cardsResponse").then((res) => {
const body = JSON.parse(res.response.body); const body = res.response.body
var expectedId = body[1].id; var expectedId = body[1].id;
var title = body[1].title; var title = body[1].title;
@ -151,7 +152,7 @@ describe("Discover Cards Requests Tests", () => {
Page.visit(); Page.visit();
cy.wait("@cardsResponse").then((res) => { cy.wait("@cardsResponse").then((res) => {
const body = JSON.parse(res.response.body); const body = res.response.body
var expectedId = body[1].id; var expectedId = body[1].id;
var title = body[1].title; var title = body[1].title;
@ -183,7 +184,7 @@ describe("Discover Cards Requests Tests", () => {
Page.visit(); Page.visit();
cy.wait("@cardsResponse").then((res) => { cy.wait("@cardsResponse").then((res) => {
const body = JSON.parse(res.response.body); const body = res.response.body
var expectedId = body[1].id; var expectedId = body[1].id;
var title = body[1].title; var title = body[1].title;
@ -220,7 +221,7 @@ describe("Discover Cards Requests Tests", () => {
Page.visit(); Page.visit();
cy.wait("@cardsResponse").then((res) => { cy.wait("@cardsResponse").then((res) => {
const body = JSON.parse(res.response.body); const body = res.response.body
var expectedId = body[1].id; var expectedId = body[1].id;
var title = body[1].title; var title = body[1].title;
@ -284,7 +285,7 @@ describe("Discover Cards Requests Tests", () => {
cy.wait("@otherResponses"); cy.wait("@otherResponses");
cy.wait("@cardsResponse").then((res) => { cy.wait("@cardsResponse").then((res) => {
const body = JSON.parse(res.response.body); const body = res.response.body
var expectedId = body[3].id; var expectedId = body[3].id;
var title = body[3].title; var title = body[3].title;
@ -337,7 +338,7 @@ describe("Discover Cards Requests Tests", () => {
cy.wait("@otherResponses"); cy.wait("@otherResponses");
cy.wait("@cardsResponse").then((res) => { cy.wait("@cardsResponse").then((res) => {
const body = JSON.parse(res.response.body); const body = res.response.body
var expectedId = body[5].id; var expectedId = body[5].id;
var title = body[5].title; var title = body[5].title;

View file

@ -199,7 +199,7 @@ describe("Discover Recently Requested Tests", () => {
}); });
}); });
it.only("Approve Requested Tv Show", () => { it("Approve Requested Tv Show", () => {
cy.requestAllTv(71712); cy.requestAllTv(71712);

View file

@ -6,13 +6,17 @@ describe("Login Tests", () => {
cy.landingSettings(false); cy.landingSettings(false);
cy.fixture("login/authenticationSettngs").then((settings) => { cy.fixture("login/authenticationSettngs").then((settings) => {
settings.enableOAuth = true; settings.enableOAuth = true;
cy.intercept("GET", "/Settings/Authentication", settings).as( cy.intercept("GET", "api/v1/Settings/Authentication", (req) => {
req.reply((res) => {
res.send(settings);
});
}).as(
"authSettings" "authSettings"
); );
}); });
Page.visit(); Page.visit();
cy.wait("@authSettings");
Page.plexSignInButton.should("be.visible"); Page.plexSignInButton.should("be.visible");
Page.ombiSignInButton.should("be.visible"); Page.ombiSignInButton.should("be.visible");
}); });
@ -21,7 +25,7 @@ describe("Login Tests", () => {
cy.landingSettings(false); cy.landingSettings(false);
cy.fixture("login/authenticationSettngs").then((settings) => { cy.fixture("login/authenticationSettngs").then((settings) => {
settings.enableOAuth = false; settings.enableOAuth = false;
cy.intercept("GET", "/Settings/Authentication", settings).as( cy.intercept("GET", "api/v1//Settings/Authentication", settings).as(
"authSettings" "authSettings"
); );
}); });

View file

@ -24,7 +24,7 @@ describe("Navigation Bar Tests", () => {
cy.removeLogin(); cy.removeLogin();
cy.loginWithCreds(id, "a"); cy.loginWithCreds(id, "a");
cy.intercept("GET", "search/Movie/Popular").as("discoverLoad"); cy.intercept("GET", "api/v2/search/Movie/Popular/**").as("discoverLoad");
Page.visit(); Page.visit();
cy.wait("@discoverLoad"); cy.wait("@discoverLoad");

View file

@ -12,7 +12,7 @@ const langs = [
]; ];
langs.forEach((l) => { langs.forEach((l) => {
it.only(`Change language to ${l.code}, UI should update`, () => { it(`Change language to ${l.code}, UI should update`, () => {
cy.intercept('POST','**/language').as('langSave'); cy.intercept('POST','**/language').as('langSave');
Page.visit(); Page.visit();