diff --git a/tests/cypress/features/01-wizard/wizard.feature b/tests/cypress/features/01-wizard/wizard.feature new file mode 100644 index 000000000..4b027b226 --- /dev/null +++ b/tests/cypress/features/01-wizard/wizard.feature @@ -0,0 +1,21 @@ + +Feature: Wizard Setup + Scenario: When visiting Ombi for the first time we should be on the Wizard page + When I visit Ombi + Then I should be on the "Wizard" + + Scenario: When navigating through the Wizard feature we are required to create a local user + When I visit Ombi + And I click through all of the pages + And I finish the Wizard + Then I should get a notification "Username '' is invalid, can only contain letters or digits." + And I should be on the User tab + + Scenario: Completing the Wizard + When I visit Ombi + And I click through to the user page + And I enter a username + And I enter a password + And I go to the finished tab + And I finish the Wizard + Then I should be on the "login" \ No newline at end of file diff --git a/tests/cypress/features/01-wizard/wizard.ts b/tests/cypress/features/01-wizard/wizard.ts new file mode 100644 index 000000000..7ce819d1a --- /dev/null +++ b/tests/cypress/features/01-wizard/wizard.ts @@ -0,0 +1,53 @@ +import { Given, When, Then } from "@badeball/cypress-cucumber-preprocessor"; +import { wizardPage as Page } from "@/integration/page-objects"; + +Given("I set the Landing Page to {string}", (bool) => { + cy.landingSettings(bool); +}); + +When("I visit Ombi", () => { + Page.visit(); +}); + +When("I click through all of the pages", () => { + Page.welcomeTab.next.click(); + Page.mediaServerTab.next.click(); + Page.localUserTab.next.click(); + Page.ombiConfigTab.next.click(); + }); + + When("I finish the Wizard", () => { + Page.finishButton.click(); + }); + + When("I click through to the user page", () => { + Page.welcomeTab.next.click(); + Page.mediaServerTab.next.click(); + }); + + When("I enter a username", () => { + Page.localUserTab.username.type(Cypress.env("username")); + }); + + When("I enter a password", () => { + Page.localUserTab.password.type(Cypress.env("password")); + }); + + When("I go to the finished tab", () => { + Page.localUserTab.next.click(); + Page.ombiConfigTab.next.click(); + }); + +Then("I should be on the {string}", (string) => { + cy.location("pathname").should("eq", `/${string}`); +}); + +Then("I should get a notification {string}", (string) => { + cy.verifyNotification(string); +}); + +Then("I should be on the User tab", () => { + Page.matStepsHeader.then((_) => { + cy.get('#cdk-step-label-0-2').should('have.attr', 'aria-selected', 'true'); + }); +}); \ No newline at end of file diff --git a/tests/cypress/tests/01-wizard/01-wizard.spec.ts b/tests/cypress/tests/01-wizard/01-wizard.spec.ts deleted file mode 100644 index a04313fd0..000000000 --- a/tests/cypress/tests/01-wizard/01-wizard.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { wizardPage as Page } from "@/integration/page-objects"; - -describe("Wizard Setup", () => { - - it("Wizard should be first page", () => { - Page.visit(); - cy.location("pathname").should("contains", "/Wizard"); - }); - - - it("Finsh with no local user", () => { - Page.visit(); - - Page.welcomeTab.next.click(); - Page.mediaServerTab.next.click(); - Page.localUserTab.next.click(); - Page.ombiConfigTab.next.click(); - Page.finishButton.click(); - - cy.verifyNotification("Username '' is invalid, can only contain letters or digits.") - - // Verify we end back up on the user page - Page.matStepsHeader.then((items) => { - - cy.get('#cdk-step-label-0-2').should('have.attr', 'aria-selected', 'true'); - - }); - - }); - - it("Compete Wizard", () => { - Page.visit(); - - Page.welcomeTab.next.click(); - Page.mediaServerTab.next.click(); - - Page.localUserTab.username.type(Cypress.env("username")); - Page.localUserTab.password.type(Cypress.env("password")); - - Page.localUserTab.next.click(); - Page.ombiConfigTab.next.click(); - - Page.finishButton.click(); - - cy.location("pathname").should("contains", "/login"); - }); -}); diff --git a/tests/cypress/tests/settings/plex/plex-settings.spec.ts b/tests/cypress/tests/settings/plex/plex-settings.spec.ts index c4c214292..bce5268d9 100644 --- a/tests/cypress/tests/settings/plex/plex-settings.spec.ts +++ b/tests/cypress/tests/settings/plex/plex-settings.spec.ts @@ -23,7 +23,7 @@ describe("Plex Settings Tests", () => { "version": "1.30.0.6442-5070ad484", "scheme": "http", "host": "2.2.2.2", - "localAddresses": "localhost", + "localAddresses": "http://host.docker.internal", "machineIdentifier": "9999999999999999", "createdAt": "5555555555", "updatedAt": "6666666666",