mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Fixed up some more tests
This commit is contained in:
parent
0eeb163a0d
commit
f2ea1d0e13
6 changed files with 101 additions and 15 deletions
|
@ -72,6 +72,10 @@ class NavBar {
|
|||
return cy.getByData('profile-image');
|
||||
}
|
||||
|
||||
get username(): Cypress.Chainable<any> {
|
||||
return cy.getByData('profile-username');
|
||||
}
|
||||
|
||||
get logout(): Cypress.Chainable<any> {
|
||||
return cy.get('#nav-logout');
|
||||
}
|
||||
|
|
85
tests/cypress/tests/api/v1/tv-request.api.spec.ts
Normal file
85
tests/cypress/tests/api/v1/tv-request.api.spec.ts
Normal file
|
@ -0,0 +1,85 @@
|
|||
describe("TV Request V1 API tests", () => {
|
||||
beforeEach(() => {
|
||||
cy.login();
|
||||
});
|
||||
|
||||
it("Request All of TV Show (Fear the Walking Dead)", () => {
|
||||
const request = {
|
||||
TvDbId: 290853,
|
||||
RequestAll: true,
|
||||
};
|
||||
|
||||
cy.api({
|
||||
url: "/api/v1/request/tv",
|
||||
body: JSON.stringify(request),
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: "Bearer " + window.localStorage.getItem("id_token"),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}).then((res) => {
|
||||
expect(res.status).equal(200);
|
||||
const body = res.body;
|
||||
expect(body.result).to.be.true;
|
||||
expect(body.requestId).not.to.be.null;
|
||||
expect(body.isError).to.be.false;
|
||||
expect(body.errorMessage).to.be.null;
|
||||
});
|
||||
});
|
||||
|
||||
it("Request First Season of TV Show (American Horror Story)", () => {
|
||||
const request = {
|
||||
TvDbId: 250487,
|
||||
FirstSeason: true,
|
||||
};
|
||||
|
||||
cy.api({
|
||||
url: "/api/v1/request/tv",
|
||||
body: JSON.stringify(request),
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: "Bearer " + window.localStorage.getItem("id_token"),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}).then((res) => {
|
||||
expect(res.status).equal(200);
|
||||
const body = res.body;
|
||||
expect(body.result).to.be.true;
|
||||
expect(body.requestId).not.to.be.null;
|
||||
expect(body.isError).to.be.false;
|
||||
expect(body.errorMessage).to.be.null;
|
||||
});
|
||||
});
|
||||
|
||||
it("Request Two Episode of First Season TV Show (The Sopranos)", () => {
|
||||
const request = {
|
||||
TvDbId: 75299,
|
||||
Seasons: [
|
||||
{
|
||||
SeasonNumber: 1,
|
||||
Episodes: [
|
||||
{ EpisodeNumber: 1 },
|
||||
{ EpisodeNumber: 2 },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
cy.api({
|
||||
url: "/api/v1/request/tv",
|
||||
body: JSON.stringify(request),
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: "Bearer " + window.localStorage.getItem("id_token"),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}).then((res) => {
|
||||
expect(res.status).equal(200);
|
||||
const body = res.body;
|
||||
expect(body.result).to.be.true;
|
||||
expect(body.requestId).not.to.be.null;
|
||||
expect(body.isError).to.be.false;
|
||||
expect(body.errorMessage).to.be.null;
|
||||
});
|
||||
});
|
||||
});
|
|
@ -11,6 +11,7 @@ describe("Navigation Bar Tests", () => {
|
|||
Page.navbar.requests.should("be.visible");
|
||||
Page.navbar.discover.should("be.visible");
|
||||
Page.navbar.userPreferences.should("be.visible");
|
||||
Page.navbar.username.contains("a");
|
||||
Page.navbar.logout.should("be.visible");
|
||||
});
|
||||
|
||||
|
@ -34,6 +35,7 @@ describe("Navigation Bar Tests", () => {
|
|||
Page.navbar.requests.should("be.visible");
|
||||
Page.navbar.discover.should("be.visible");
|
||||
Page.navbar.userPreferences.should("be.visible");
|
||||
Page.navbar.username.contains(id);
|
||||
Page.navbar.logout.should("be.visible");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue