mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
features
This commit is contained in:
parent
dc0a66f4d8
commit
618a775eb3
7 changed files with 404 additions and 2969 deletions
|
@ -1,4 +1,7 @@
|
|||
import { defineConfig } from 'cypress'
|
||||
import { defineConfig } from 'cypress';
|
||||
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
|
||||
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
|
||||
import createEsbuildPlugin from "@badeball/cypress-cucumber-preprocessor/esbuild";
|
||||
|
||||
export default defineConfig({
|
||||
watchForFileChanges: true,
|
||||
|
@ -17,11 +20,25 @@ export default defineConfig({
|
|||
e2e: {
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
return require('./cypress/plugins/index.js')(on, config)
|
||||
async setupNodeEvents(
|
||||
on: Cypress.PluginEvents,
|
||||
config: Cypress.PluginConfigOptions
|
||||
): Promise<Cypress.PluginConfigOptions> {
|
||||
await addCucumberPreprocessorPlugin(on, config);
|
||||
|
||||
on(
|
||||
"file:preprocessor",
|
||||
createBundler({
|
||||
plugins: [createEsbuildPlugin(config)],
|
||||
})
|
||||
);
|
||||
|
||||
// Make sure to return the config object as it might have been modified by the plugin.
|
||||
return config;
|
||||
// return require('./cypress/plugins/index.js')(on, config)
|
||||
},
|
||||
baseUrl: 'http://localhost:5000',
|
||||
specPattern: 'cypress/tests/**/*.spec.ts*',
|
||||
baseUrl: 'http://localhost:3577',
|
||||
specPattern: ['cypress/tests/**/*.spec.ts*', '**/*.feature'],
|
||||
excludeSpecPattern: ['**/snapshots/*'],
|
||||
},
|
||||
})
|
||||
|
|
13
tests/cypress/features/login.feature
Normal file
13
tests/cypress/features/login.feature
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
Feature: Login Page
|
||||
Scenario: When visiting Ombi and the Landing Page is enabled, we should end up on the landing page
|
||||
Given I set the Landing Page to "true"
|
||||
When I visit Ombi
|
||||
Then I should be on the "landingpage"
|
||||
Then I click continue
|
||||
Then I should be on the "login/true"
|
||||
|
||||
Scenario: When visiting Ombi and the Landing Page is disabled, we should end up on the login page
|
||||
Given I set the Landing Page to "false"
|
||||
When I visit Ombi
|
||||
Then I should be on the "login"
|
19
tests/cypress/features/login.ts
Normal file
19
tests/cypress/features/login.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { After, Before, Given, When, Then } from "@badeball/cypress-cucumber-preprocessor";
|
||||
import { loginPage as Page } from "@/integration/page-objects";
|
||||
|
||||
Given("I set the Landing Page to {string}", (bool) => {
|
||||
cy.landingSettings(bool);
|
||||
});
|
||||
|
||||
When("I visit Ombi", () => {
|
||||
Page.visit();
|
||||
});
|
||||
|
||||
Then("I should be on the {string}", (string) => {
|
||||
cy.location("pathname").should("eq", `/${string}`);
|
||||
|
||||
});
|
||||
|
||||
Then("I click continue", () => {
|
||||
cy.get("[data-cy=continue]").click();
|
||||
});
|
|
@ -1,20 +1,6 @@
|
|||
import { loginPage as Page } from "@/integration/page-objects";
|
||||
|
||||
describe("Login Tests", () => {
|
||||
it("Landing Page is enabled, should redirect", () => {
|
||||
cy.landingSettings(true);
|
||||
Page.visit();
|
||||
cy.location("pathname").should("eq", "/landingpage");
|
||||
cy.get("[data-cy=continue]").click();
|
||||
cy.location("pathname").should("contains", "/login");
|
||||
});
|
||||
|
||||
it("Landing Page is disabled, should not redirect", () => {
|
||||
cy.landingSettings(false);
|
||||
Page.visit();
|
||||
|
||||
cy.location("pathname").should("eq", "/login");
|
||||
});
|
||||
|
||||
it("Plex OAuth Enabled, should be button", () => {
|
||||
cy.landingSettings(false);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
"devDependencies": {
|
||||
"@badeball/cypress-cucumber-preprocessor": "^14.0.0",
|
||||
"@bahmutov/cy-api": "^1.5.0",
|
||||
"@bahmutov/cypress-esbuild-preprocessor": "^2.1.5",
|
||||
"cypress": "11.2.0",
|
||||
"cypress-cucumber-preprocessor": "^4.3.1",
|
||||
"cypress-wait-until": "^1.7.1",
|
||||
"typescript": "^4.2.3"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"target": "es6",
|
||||
"esModuleInterop": true,
|
||||
"lib": ["es2018", "dom"],
|
||||
"types": ["cypress", "cypress-wait-until", "cypress-image-snapshot", "cypress-real-events", "@bahmutov/cy-api", "node"],
|
||||
"baseUrl": "./cypress",
|
||||
|
|
3294
tests/yarn.lock
3294
tests/yarn.lock
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue