mirror of https://github.com/Ombi-app/Ombi
Fixed the issue where we could not delete users #2558
parent
1de276a425
commit
d9e25522e1
@ -0,0 +1,4 @@
|
||||
{
|
||||
"projectId": "gms1wj",
|
||||
"baseUrl": "http://localhost:3577"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "Using fixtures to represent data",
|
||||
"email": "hello@cypress.io",
|
||||
"body": "Fixtures are a great way to mock data for responses to routes"
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/// <reference types="Cypress" />
|
||||
|
||||
describe('Login Page', function () {
|
||||
it('Invalid Password', function () {
|
||||
cy.visit('/');
|
||||
cy.contains('Sign in');
|
||||
|
||||
cy.get('#inputEmail').type('automation');
|
||||
cy.get('#inputPassword').type('incorrectpw');
|
||||
|
||||
cy.get('[data-test=signinbtn]').click();
|
||||
cy.get('.ui-growl-title').should('be.visible');
|
||||
cy.get('.ui-growl-title').next().contains('Incorrect username')
|
||||
});
|
||||
|
||||
it('Invalid Username', function () {
|
||||
cy.visit('/');
|
||||
cy.contains('Sign in');
|
||||
|
||||
cy.get('#inputEmail').type('bad username');
|
||||
cy.get('#inputPassword').type('incorrectpw');
|
||||
|
||||
cy.get('[data-test=signinbtn]').click();
|
||||
cy.get('.ui-growl-title').should('be.visible');
|
||||
cy.get('.ui-growl-title').next().contains('Incorrect username')
|
||||
});
|
||||
|
||||
it('Correct Login', function () {
|
||||
cy.visit('/');
|
||||
cy.contains('Sign in');
|
||||
|
||||
cy.get('#inputEmail').type('automation');
|
||||
cy.get('#inputPassword').type('password');
|
||||
|
||||
cy.get('[data-test=signinbtn]').click();
|
||||
cy.url().should('include', '/search')
|
||||
});
|
||||
})
|
@ -0,0 +1,48 @@
|
||||
/// <reference types="Cypress" />
|
||||
|
||||
describe('User Management Page', function () {
|
||||
beforeEach(function () {
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: 'http://localhost:3577/api/v1/token',
|
||||
body: {
|
||||
username: 'automation',
|
||||
password: 'password',
|
||||
}
|
||||
})
|
||||
.then((resp) => {
|
||||
window.localStorage.setItem('id_token', resp.body.access_token)
|
||||
});
|
||||
|
||||
cy.visit('/usermanagement');
|
||||
});
|
||||
|
||||
it('Loads users table', function () {
|
||||
cy.contains("User Management");
|
||||
cy.contains("Add User To Ombi");
|
||||
});
|
||||
|
||||
it.only('Creates basic user', function(){
|
||||
cy.get('[data-test=adduserbtn').click();
|
||||
cy.url().should('include','/user');
|
||||
|
||||
// Setup the form
|
||||
cy.get('#username').type("user1");
|
||||
cy.get('#alias').type("alias1");
|
||||
cy.get('#emailAddress').type("user1@emailaddress.com");
|
||||
cy.get('#password').type("password");
|
||||
cy.get('#confirmPass').type("password");
|
||||
|
||||
// setup the roles
|
||||
cy.contains('Roles').click()
|
||||
cy.get('#labelRequestTv').click();
|
||||
cy.get('#labelRequestMovie').click();
|
||||
|
||||
// submit user
|
||||
cy.get('[data-test=createuserbtn]').click();
|
||||
|
||||
cy.get('.ui-growl-title').should('be.visible');
|
||||
cy.get('.ui-growl-title').next().contains('has been created successfully')
|
||||
});
|
||||
|
||||
})
|
@ -0,0 +1,21 @@
|
||||
describe('Wizard Setup Tests', function() {
|
||||
it('Setup Wizard User', function() {
|
||||
cy.visit('http://localhost:3577/');
|
||||
cy.url().should('include', '/Wizard')
|
||||
|
||||
cy.get('[data-test=nextbtn]').click();
|
||||
|
||||
// Media server page
|
||||
cy.contains('Please choose your media server');
|
||||
cy.get('[data-test=skipbtn]').click();
|
||||
|
||||
// Create user
|
||||
cy.contains('Create the Admin account');
|
||||
cy.get('#adminUsername').type('automation');
|
||||
cy.get('#adminPassword').type('password');
|
||||
|
||||
// Submit user
|
||||
cy.get('[data-test=createuserbtn]').click();
|
||||
cy.contains('Sign in');
|
||||
})
|
||||
})
|
@ -0,0 +1,17 @@
|
||||
// ***********************************************************
|
||||
// This example plugins/index.js can be used to load plugins
|
||||
//
|
||||
// You can change the location of this file or turn off loading
|
||||
// the plugins file with the 'pluginsFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/plugins-guide
|
||||
// ***********************************************************
|
||||
|
||||
// This function is called when a project is opened or re-opened (e.g. due to
|
||||
// the project's config changing)
|
||||
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add("login", (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
@ -0,0 +1,20 @@
|
||||
// ***********************************************************
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"baseUrl": "../node_modules",
|
||||
"types": [
|
||||
"cypress"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"**/*.*"
|
||||
]
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue