This repository was archived by the owner on Feb 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setup cypress * Update utils * Add first e2e test * Add functions to generate utils * Add classNames * Update snapshots * Add tests for header * Add tests for home page * Add login page spec * Update readme * Remove videos
- Loading branch information
Showing
17 changed files
with
571 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"viewportWidth": 1200, | ||
"video": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { homePage } from '../../support'; | ||
import { createInput, createLongerInput } from '../../support/utils'; | ||
|
||
describe('User is not logged in', () => { | ||
const studioLabel = createInput(); | ||
const description = createLongerInput(); | ||
const workspaceLabel = createInput(); | ||
const workspaceDescription = createLongerInput(); | ||
const dashboardLabel = createInput(); | ||
const dashboardDescpription = createLongerInput(); | ||
|
||
it('Creates Studio with Workspace and Dashboard', () => { | ||
cy.visit(homePage); | ||
cy.contains('Organizations'); | ||
cy.get('.ListItem').click(); | ||
cy.get('.ListItem').click(); | ||
cy.contains('Studios').click(); | ||
cy.contains('Create Studio').click(); | ||
cy.get('.ui-studio-label-input').type(studioLabel); | ||
cy.get('.ui-studio-description-input').type(description); | ||
cy.get('form').submit(); | ||
cy.wait(3000); | ||
cy.contains(studioLabel); | ||
cy.contains(description); | ||
cy.contains('Add Workspace').click(); | ||
cy.get('.ui-workspace-label-input').type(workspaceLabel); | ||
cy.get('.ui-workspace-description-input').type(workspaceDescription); | ||
cy.get('form').submit(); | ||
cy.contains(workspaceLabel); | ||
cy.contains('Add Dashboard').click(); | ||
cy.contains('Create Dashboard'); | ||
cy.get('.ui-dashboard-label-input').type(dashboardLabel); | ||
cy.get('.ui-dashboard-description-input').type(dashboardDescpription); | ||
cy.get('form').submit(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { homePage, docLink, reportIssueLink } from '../../support'; | ||
|
||
describe('Header', () => { | ||
beforeEach(() => { | ||
cy.visit(homePage); | ||
}); | ||
|
||
it('contains the title', () => { | ||
cy.contains('h1', 'Nexus'); | ||
}); | ||
|
||
it('contains the link to the homepage', () => { | ||
cy.contains('a', 'Nexus').should('have.attr', 'href', ''); | ||
}); | ||
|
||
it('has the login link', () => { | ||
cy.contains('a', 'login'); | ||
}); | ||
|
||
it('contains the link to docs', () => { | ||
cy.contains('a', 'Documentation').should('have.attr', 'href', docLink); | ||
}); | ||
|
||
it('contains the link to open a github issue', () => { | ||
cy.contains('a', 'Report Issue').should( | ||
'have.attr', | ||
'href', | ||
reportIssueLink | ||
); | ||
}); | ||
|
||
it('contains the information button', () => { | ||
cy.get('.ui-header-info-button').should('be.visible'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { homePage } from '../../support'; | ||
|
||
describe('Homepage', () => { | ||
beforeEach(() => { | ||
cy.visit(homePage); | ||
}); | ||
|
||
it('has a header', () => { | ||
cy.get('header.Header').should('be.visible'); | ||
}); | ||
|
||
it('show a list of organisations', () => { | ||
cy.contains('h1', 'Organizations'); | ||
}); | ||
|
||
it('loads organizations', () => { | ||
cy.server(); | ||
cy.route('GET', '/orgs?deprecated=false&size=20'); | ||
}); | ||
|
||
it('allows to search for an organization', () => { | ||
cy.get('input').type('bbp'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { loginPage } from '../../support'; | ||
|
||
describe('Login page', () => { | ||
beforeEach(() => { | ||
cy.visit(loginPage); | ||
}); | ||
|
||
it('has a header', () => { | ||
cy.get('header.Header').should('be.visible'); | ||
}); | ||
|
||
it('contains the Nexus logo', () => { | ||
cy.get('.logo').should('be.visible'); | ||
}); | ||
|
||
it('has the login button', () => { | ||
cy.contains('button', 'Log in'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 will overwrite an existing command -- | ||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// *********************************************************** | ||
// 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: | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') | ||
|
||
import './commands'; | ||
|
||
export const homePage = 'http://localhost:8000'; | ||
export const loginPage = 'http://localhost:8000/login'; | ||
|
||
export const docLink = 'https://bluebrainnexus.io/docs'; | ||
export const reportIssueLink = | ||
'https://github.com/BlueBrain/nexus/issues/new?labels=frontend,nexus-web'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const inputs = [ | ||
'thalamus', | ||
'neurotransmitters', | ||
'angiography', | ||
'cerebrospinal', | ||
'mapping', | ||
'cortex', | ||
'synaptic', | ||
'vestibular', | ||
'optogenetics', | ||
'neuron', | ||
'microglia', | ||
'insula', | ||
'expression', | ||
'phenotyping', | ||
'connectome', | ||
'sensory', | ||
'spinal', | ||
'cord', | ||
'data', | ||
'ion', | ||
'potential', | ||
'stem', | ||
'integrative', | ||
'project', | ||
'cognition', | ||
'neocortical', | ||
'biomedical', | ||
'molecular', | ||
'polyphenols', | ||
'trans-resveratrol', | ||
'angiographic', | ||
'multimerization', | ||
'derivatives', | ||
'randomized', | ||
'vivarium', | ||
'monophosphate', | ||
'protein', | ||
'measurements', | ||
'procedure', | ||
]; | ||
|
||
const randomValue = array => array[Math.floor(Math.random() * array.length)]; | ||
|
||
export const createInput = () => { | ||
return randomValue(inputs) + '-cy-test'; | ||
}; | ||
|
||
export const createLongerInput = () => { | ||
return randomValue(inputs) + ' ' + randomValue(inputs) + 'cypress test'; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.