-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create user test and researchplan extended test are added * collections api spec is now added * deleted unnecessary comments from collection_api_spec.cy.js * Remove redundant API test for now (conceptually replicated RSpec) * fixed failing test cases due to changes in chemotion ELN * fixed failing test and removed typos --------- Co-authored-by: Jan C. Brammer <[email protected]>
- Loading branch information
1 parent
4128992
commit 8347fe8
Showing
11 changed files
with
143 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"sqltools.connections": [ | ||
{ | ||
"previewLimit": 50, | ||
"server": "postgres", | ||
"port": 5432, | ||
"driver": "PostgreSQL", | ||
"name": "development", | ||
"database": "chemotion_dev", | ||
"username": "postgres", | ||
"password": "" | ||
}, | ||
{ | ||
"previewLimit": 50, | ||
"server": "postgres", | ||
"port": 5432, | ||
"driver": "PostgreSQL", | ||
"name": "test", | ||
"database": "chemotion_test", | ||
"username": "postgres", | ||
"password": "" | ||
} | ||
], | ||
} |
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,65 @@ | ||
function getMonthNames() { | ||
const months = [ | ||
"January", "February", "March", "April", "May", "June", | ||
"July", "August", "September", "October", "November", "December" | ||
]; | ||
|
||
const currentDate = new Date(); | ||
const currentMonth = currentDate.getMonth(); | ||
|
||
const prevMonth = (currentMonth === 0) ? 11 : currentMonth - 1; | ||
const nextMonth = (currentMonth === 11) ? 0 : currentMonth + 1; | ||
|
||
return { | ||
previousMonth: months[prevMonth], | ||
currentMonth: months[currentMonth], | ||
nextMonth: months[nextMonth] | ||
}; | ||
} | ||
|
||
|
||
describe('Calendar specs', () => { | ||
beforeEach(() => { | ||
cy.createDefaultUser('[email protected]', 'cu1'); | ||
cy.visit('users/sign_in'); | ||
}); | ||
|
||
it('open and close Calendar with close button', () => { | ||
cy.login('cu1', 'user_password'); | ||
|
||
cy.get('.navCalendarButton > .btn').click(); | ||
cy.get('.calendarHeaderActions > .btn-danger').as('close'); | ||
cy.get('@close').click(); | ||
}); | ||
|
||
it('open and close Calendar when click on background', () => { | ||
cy.login('cu1', 'user_password'); | ||
cy.get('.navCalendarButton > .btn').click(); | ||
cy.get('.rbc-toolbar > :nth-child(3) > :nth-child(1)').click(); | ||
cy.get('.calendarModalBackground').as('bg'); | ||
cy.get('@bg').click({force: true}); | ||
}); | ||
|
||
it('check Today/Back/Next month', () => { | ||
cy.login('cu1', 'user_password'); | ||
cy.get('.navCalendarButton > .btn').click(); | ||
|
||
const { previousMonth, currentMonth, nextMonth } = getMonthNames(); | ||
|
||
cy.get('.rbc-toolbar > :nth-child(3) > :nth-child(1)').as('month'); | ||
cy.get('@month').click(); | ||
|
||
cy.get('.rbc-toolbar > :nth-child(1) > :nth-child(1)').as('today'); | ||
cy.get('@today').click(); | ||
cy.get('.rbc-toolbar-label').contains(currentMonth); | ||
|
||
cy.get('.rbc-toolbar > :nth-child(1) > :nth-child(2)').as('back'); | ||
cy.get('@back').click(); | ||
cy.get('.rbc-toolbar-label').contains(previousMonth); | ||
|
||
cy.get('.rbc-toolbar > :nth-child(1) > :nth-child(3)').as('next'); | ||
cy.get('@next').click(); | ||
cy.get('@next').click(); | ||
cy.get('.rbc-toolbar-label').contains(nextMonth); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
describe('Sample API Testing', () => { | ||
|
||
it('GET samples/', () => { | ||
cy.createDefaultUser('[email protected]', 'CU').then((user) => { | ||
cy.appFactories([['create', 'collection', { user_id: user[0].id, label: 'Col1' }]]); | ||
}); | ||
cy.visit('users/sign_in'); | ||
cy.login('CU', 'user_password'); | ||
cy.request('/api/v1/samples.json').as('samples'); | ||
cy.get('@samples').then(response => { | ||
expect(response.status).to.eq(200); | ||
expect(response.body['samples'].length).to.eq(0); | ||
}); | ||
}); | ||
|
||
it('GET samples/', () => { | ||
cy.appFactories([['create', 'valid_sample']]); | ||
cy.appFactories([['create', 'collection', { user_id: 1, label: 'Col1' }]]); | ||
cy.login('[email protected]', 'testtest'); | ||
cy.request('/api/v1/samples.json').as('samples'); | ||
cy.get('@samples').then(response => { | ||
const sampleData = response.body['samples'][0]; | ||
expect(response.status).to.eq(200); | ||
expect(response.body['samples'].length).to.eq(1); | ||
expect(sampleData.id).to.eq(1); | ||
expect(sampleData.metrics).to.eq('mmm'); | ||
expect(sampleData.short_label).to.eq('a01-1'); | ||
expect(sampleData.name).to.eq('Sample 1'); | ||
expect(sampleData.type).to.eq('sample'); | ||
expect(sampleData.molecule.boiling_point).to.eq(100); | ||
console.log(response.body['samples'][0]); | ||
}); | ||
}); | ||
}); |
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
Binary file added
BIN
+138 KB
...arch_plan.cy.js/Research Plan -- create and delete a research plan (failed).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.