Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
svevang committed Jul 1, 2024
1 parent d17a904 commit d99d885
Showing 1 changed file with 47 additions and 51 deletions.
98 changes: 47 additions & 51 deletions cypress/e2e/augury.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,72 +82,68 @@ describe("Augury", () => {
// cy.contains("Creative deleted");
});


it("checks inventory availability", () => {
cy.visit("/availability");

// Functions to be implemented
cy.getStartDateInput().type("2024-07-01");
cy.getEndDateInput().type("2024-07-31");
cy.selectSlimSelect("#inventory_id", "Acceptance Test Series")
cy.selectSlimSelect("#zone", "House Preroll")

cy.getAvailabilityResults().should("be.visible");
cy.getAvailabilityResults().contains("Calculate");
cy.getAvailabilityResults().click();

// page should container "Forecasted Inventory"
cy.contains("Forecasted Inventory");
});

it("generates a campaign report", () => {
// Assuming we have a campaign with ID 1
cy.visit("/reports");
cy.contains("Navigate to different types of reports across Dovetail");


cy.get("#campaign_id + .ss-main").click() // Open the dropdown

// The dropdown is disconnected/supra of the #campaign_id element
var res = cy.get(".ss-open-below .ss-search input[type=search]").click({ multiple: true });
res.type("C");
cy.contains("Campaign Acceptance Test");
res.type("{downArrow}{enter}");

cy.get("#campaign_id").closest(".card").find(".btn").click();

cy.contains("Report Builder");

});
it("checks inventory availability", () => {
cy.visit("/availability");

// Functions to be implemented
cy.getStartDateInput().type("2024-07-01");
cy.getEndDateInput().type("2024-07-31");
cy.selectSlimSelect("#inventory_id", "Acceptance Test Series");
cy.selectSlimSelect("#zone", "House Preroll");

cy.getAvailabilityResults().should("be.visible");
cy.getAvailabilityResults().contains("Calculate");
cy.getAvailabilityResults().click();

// page should container "Forecasted Inventory"
cy.contains("Forecasted Inventory");
});

it("generates a campaign report", () => {
// Assuming we have a campaign with ID 1
cy.visit("/reports");
cy.contains("Navigate to different types of reports across Dovetail");

cy.get("#campaign_id + .ss-main").click(); // Open the dropdown

// The dropdown is disconnected/supra of the #campaign_id element
var res = cy.get(".ss-open-below .ss-search input[type=search]").click({ multiple: true });

Check failure on line 110 in cypress/e2e/augury.cy.ts

View workflow job for this annotation

GitHub Actions / check-javascript / check-javascript

Do not assign the return value of a Cypress command

Check failure on line 110 in cypress/e2e/augury.cy.ts

View workflow job for this annotation

GitHub Actions / check-javascript / check-javascript

All 'var' declarations must be at the top of the function scope

Check failure on line 110 in cypress/e2e/augury.cy.ts

View workflow job for this annotation

GitHub Actions / check-javascript / check-javascript

Unexpected var, use let or const instead
res.type("C");
cy.contains("Campaign Acceptance Test");
res.type("{downArrow}{enter}");

cy.get("#campaign_id").closest(".card").find(".btn").click();

cy.contains("Report Builder");
});
});

declare namespace Cypress {
interface Chainable<Subject = any> {

Check failure on line 122 in cypress/e2e/augury.cy.ts

View workflow job for this annotation

GitHub Actions / check-javascript / check-javascript

'Subject' is defined but never used
getStartDateInput(): Chainable<JQuery<HTMLElement>>
getEndDateInput(): Chainable<JQuery<HTMLElement>>
getInventoryTypeSelect(): Chainable<JQuery<HTMLElement>>
getAvailabilityResults(): Chainable<JQuery<HTMLElement>>
selectSlimSelect(selector: string, value: string): Chainable<JQuery<HTMLElement>>
getStartDateInput(): Chainable<JQuery<HTMLElement>>;

Check failure on line 123 in cypress/e2e/augury.cy.ts

View workflow job for this annotation

GitHub Actions / check-javascript / check-javascript

'JQuery' is not defined
getEndDateInput(): Chainable<JQuery<HTMLElement>>;

Check failure on line 124 in cypress/e2e/augury.cy.ts

View workflow job for this annotation

GitHub Actions / check-javascript / check-javascript

'JQuery' is not defined
getInventoryTypeSelect(): Chainable<JQuery<HTMLElement>>;
getAvailabilityResults(): Chainable<JQuery<HTMLElement>>;
selectSlimSelect(selector: string, value: string): Chainable<JQuery<HTMLElement>>;
}
}

// Custom commands that can be chained
Cypress.Commands.add("getStartDateInput", () => {
return cy.get('input#start_date')
return cy.get("input#start_date");
});

Cypress.Commands.add("getEndDateInput", () => {
return cy.get('input#end_date')
return cy.get("input#end_date");
});

Cypress.Commands.add("getInventoryTypeSelect", () => {
});
Cypress.Commands.add("getInventoryTypeSelect", () => {});

Cypress.Commands.add('selectSlimSelect', (selector, value) => {
cy.get(`${selector} + .ss-main`).click() // Open the dropdown
cy.get('.ss-option').contains(value).click() // Select the option
})
Cypress.Commands.add("selectSlimSelect", (selector, value) => {
cy.get(`${selector} + .ss-main`).click(); // Open the dropdown
cy.get(".ss-option").contains(value).click(); // Select the option
});

Cypress.Commands.add("getAvailabilityResults", () => {
cy.get('form.button_to button[type="submit"]')
cy.get('form.button_to button[type="submit"]');
});

0 comments on commit d99d885

Please sign in to comment.