mirror of https://github.com/Ombi-app/Ombi
parent
77ac5e77cc
commit
3c37a21ab3
@ -1,10 +1,10 @@
|
||||
<h1 mat-dialog-title>{{ 'Requests.DenyReason' | translate}}</h1>
|
||||
<div mat-dialog-content>
|
||||
<mat-form-field>
|
||||
<input matInput [(ngModel)]="denyReason">
|
||||
<input id="denyInput" matInput [(ngModel)]="denyReason">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div mat-dialog-actions>
|
||||
<button mat-raised-button (click)="onNoClick()" [mat-dialog-close]="data.denied">Cancel</button>
|
||||
<button mat-raised-button (click)="deny()" color="danger" [mat-dialog-close]="data.denied" cdkFocusInitial>Deny</button>
|
||||
<button mat-raised-button (click)="onNoClick()" [mat-dialog-close]="data.denied">{{ 'Common.Cancel' | translate }}</button>
|
||||
<button mat-raised-button id="denyButton" (click)="deny()" color="danger" [mat-dialog-close]="data.denied" cdkFocusInitial>{{ 'Requests.Deny' | translate}}</button>
|
||||
</div>
|
@ -0,0 +1,91 @@
|
||||
import { BasePage } from "../../base.page";
|
||||
|
||||
class MovieInformationPanel {
|
||||
|
||||
get denyReason(): Cypress.Chainable<any> {
|
||||
return cy.get('#deniedReasonInfo');
|
||||
}
|
||||
}
|
||||
|
||||
class DenyModal {
|
||||
|
||||
get denyReason(): Cypress.Chainable<any> {
|
||||
return cy.get('#denyInput');
|
||||
}
|
||||
|
||||
get denyButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#denyButton');
|
||||
}
|
||||
}
|
||||
|
||||
class MovieDetailsPage extends BasePage {
|
||||
|
||||
get title(): Cypress.Chainable<any> {
|
||||
return cy.get('#mediaTitle');
|
||||
}
|
||||
|
||||
get availableButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#availableBtn');
|
||||
}
|
||||
|
||||
get requestButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#requestBtn');
|
||||
}
|
||||
|
||||
get requestedButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#requestedBtn');
|
||||
}
|
||||
|
||||
get approveButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#approveBtn');
|
||||
}
|
||||
|
||||
get markAvailableButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#markAvailableBtn');
|
||||
}
|
||||
|
||||
get denyButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#denyBtn');
|
||||
}
|
||||
|
||||
get deniedButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#deniedButton');
|
||||
}
|
||||
|
||||
get reportIssueButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#reportIssueBtn');
|
||||
}
|
||||
|
||||
get viewCollectionButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#viewCollectionBtn');
|
||||
}
|
||||
|
||||
get viewOnPlexButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#viewOnPlexButton');
|
||||
}
|
||||
|
||||
get viewOnEmbyButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#viewOnEmbyButton');
|
||||
}
|
||||
|
||||
get viewOnJellyfinButton(): Cypress.Chainable<any> {
|
||||
return cy.get('#viewOnJellyfinButton');
|
||||
}
|
||||
|
||||
denyModal = new DenyModal();
|
||||
informationPanel = new MovieInformationPanel();
|
||||
|
||||
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/movie/` + id, options);
|
||||
}
|
||||
}
|
||||
|
||||
export const movieDetailsPage = new MovieDetailsPage();
|
@ -0,0 +1,149 @@
|
||||
import { movieDetailsPage as Page } from "@/integration/page-objects";
|
||||
|
||||
describe("Movie Details Buttons", () => {
|
||||
it("Movie Requested by Admin should be auto approved", () => {
|
||||
cy.login();
|
||||
|
||||
Page.visit("587807");
|
||||
Page.requestButton.click();
|
||||
cy.verifyNotification("Tom & Jerry (2021) has been successfully added");
|
||||
|
||||
Page.requestedButton.should("be.visible");
|
||||
});
|
||||
|
||||
it("Movie Requested by Regular user should be pending", () => {
|
||||
cy.generateUniqueId().then((id) => {
|
||||
cy.login();
|
||||
const roles = [];
|
||||
roles.push({ value: "RequestMovie", enabled: true });
|
||||
cy.createUser(id, "a", roles).then(() => {
|
||||
cy.loginWithCreds(id, "a");
|
||||
|
||||
Page.visit("651571");
|
||||
|
||||
Page.requestButton.click();
|
||||
cy.verifyNotification("Breach (2020) has been successfully added");
|
||||
|
||||
Page.requestedButton.should("be.visible");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("Movie Requested by Regular with no movie permission", () => {
|
||||
cy.generateUniqueId().then((id) => {
|
||||
cy.login();
|
||||
const roles = [];
|
||||
roles.push({ value: "RequestTv", enabled: true });
|
||||
cy.createUser(id, "a", roles).then(() => {
|
||||
cy.loginWithCreds(id, "a");
|
||||
|
||||
Page.visit("791373");
|
||||
|
||||
Page.requestButton.click();
|
||||
cy.verifyNotification("You do not have permissions to Request a Movie");
|
||||
|
||||
Page.requestedButton.should("not.exist");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("Movie Requested by Regular can be approved by admin", () => {
|
||||
cy.generateUniqueId().then((id) => {
|
||||
cy.login();
|
||||
const roles = [];
|
||||
roles.push({ value: "RequestMovie", enabled: true });
|
||||
cy.createUser(id, "a", roles).then(() => {
|
||||
cy.loginWithCreds(id, "a");
|
||||
|
||||
Page.visit("793723");
|
||||
|
||||
Page.requestButton.click();
|
||||
cy.verifyNotification("Sentinelle (2021) has been successfully added");
|
||||
|
||||
Page.requestedButton.should("be.visible");
|
||||
|
||||
// Login as admin now
|
||||
cy.removeLogin();
|
||||
cy.login();
|
||||
cy.reload();
|
||||
|
||||
Page.visit("793723");
|
||||
|
||||
Page.approveButton.should("exist");
|
||||
Page.approveButton.click();
|
||||
|
||||
cy.verifyNotification("Successfully Approved");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("Movie Requested, mark as available", () => {
|
||||
cy.login();
|
||||
|
||||
Page.visit("399566");
|
||||
|
||||
Page.requestButton.click();
|
||||
cy.verifyNotification(
|
||||
"Godzilla vs. Kong (2021) has been successfully added"
|
||||
);
|
||||
|
||||
cy.reload();
|
||||
|
||||
Page.markAvailableButton.should("exist");
|
||||
Page.markAvailableButton.click();
|
||||
|
||||
cy.verifyNotification("Request is now available");
|
||||
Page.availableButton.should("exist");
|
||||
});
|
||||
|
||||
it("Movie Requested, Deny Movie", () => {
|
||||
cy.login();
|
||||
|
||||
Page.visit("484718");
|
||||
|
||||
Page.requestButton.click();
|
||||
cy.verifyNotification(
|
||||
"Coming 2 America (2021) has been successfully added"
|
||||
);
|
||||
|
||||
cy.reload();
|
||||
|
||||
Page.denyButton.should("exist");
|
||||
Page.denyButton.click();
|
||||
|
||||
Page.denyModal.denyReason.type("Automation Tests");
|
||||
Page.denyModal.denyButton.click();
|
||||
|
||||
Page.deniedButton.should('exist');
|
||||
|
||||
cy.verifyNotification("Denied Request");
|
||||
|
||||
Page.informationPanel.denyReason.should('have.text', "Automation Tests");
|
||||
});
|
||||
|
||||
it("Movie View Collection should be available", () => {
|
||||
cy.login();
|
||||
|
||||
Page.visit("671");
|
||||
|
||||
Page.viewCollectionButton.should('be.visible');
|
||||
});
|
||||
|
||||
it.only("Non requested movie valid buttons", () => {
|
||||
cy.login();
|
||||
|
||||
Page.visit("590706");
|
||||
|
||||
Page.viewCollectionButton.should('not.exist');
|
||||
Page.approveButton.should('not.exist');
|
||||
Page.denyButton.should('not.exist');
|
||||
Page.deniedButton.should('not.exist');
|
||||
Page.markAvailableButton.should('not.exist');
|
||||
Page.viewOnEmbyButton.should('not.exist');
|
||||
Page.viewOnJellyfinButton.should('not.exist');
|
||||
Page.viewOnPlexButton.should('not.exist');
|
||||
Page.requestedButton.should('not.exist');
|
||||
Page.reportIssueButton.should('not.exist'); // Issuess not enabled
|
||||
Page.requestButton.should('exist');
|
||||
});
|
||||
});
|
Loading…
Reference in new issue