Skip to content

UTS-eResearch/redbox-portal-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redbox-portal e2e testing using Cypress.io framework

Used with config-uts-feature-ethics test the creation of data management plans using cypress

How to run:

  • install
npm install
  • open cypress
export cypress_username=USERNAME cypress_password=PASSWORD && npm run cypress:open

(use set cypress_username=USERNAME cypress_password=PASSWORD) for windows

  • run headless
npm run cypress:run --env cypress_username=USERNAME,cypress_password=PASSWORD

This will open cypress app and list specs run

  • config

cypress.json

base url app:

{
  "baseUrl": "http://localhost:1500"
}

cypress/support/index.js White list sails.sid csrf cookie

Cypress.Cookies.defaults({
    whitelist: 'sails.sid'
});

Use restore and save local storage:

beforeEach(() => {
    cy.restoreLocalStorage();
});
afterEach(() => {
    cy.saveLocalStorage();
});

Login with CSRF with command added to cypress/support/commands; Example:

cy.loginByCSRF(_csrf, username, password)
    .then((resp) => {
        expect(resp.status).to.eq(200);
        expect(resp.body).to.include('Welcome to Stash');
    });

About

redbox-portal front-end e2e test

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors