-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cdc425d
commit d23d8df
Showing
6 changed files
with
73 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* global cy, it, describe, beforeEach */ | ||
|
||
describe('queue', () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
cy.findByRole('link', { name: 'MXCuBE-Web (OSC)' }).should('be.visible'); | ||
cy.takeControl(); | ||
}); | ||
|
||
it('mount a test sample', () => { | ||
cy.mountSample('test', 'test'); | ||
cy.findByText('Sample: test - test').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,41 @@ | ||
/* global cy, it, describe, beforeEach, Cypress */ | ||
|
||
describe('3-click centring', () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
cy.findByRole('link', { name: 'MXCuBE-Web (OSC)' }).should('be.visible'); | ||
cy.takeControl(); | ||
}); | ||
|
||
it('3-click centring should not work without sample', () => { | ||
cy.clearSamples(); | ||
cy.contains('button', '3-click centring').click(); | ||
cy.findByRole('alert', 'Error: There is no sample mounted').should( | ||
'be.visible', | ||
); | ||
}); | ||
|
||
it('Each click is rotating the sample by 90 degrees', () => { | ||
cy.mountSample(); | ||
cy.contains('button', '3-click centring').click(); | ||
/* eslint-disable-next-line promise/catch-or-return */ | ||
cy.get('.form-control[name="diffractometer.phi"]') | ||
.invoke('val') | ||
/* eslint-disable-next-line promise/prefer-await-to-then */ | ||
.then((value) => { | ||
let omegaValue = Number.parseFloat(value); | ||
Cypress._.times(2, () => { | ||
omegaValue += 90; | ||
cy.get('.canvas-container').click(); | ||
// to update the omega value, a small amount of time must be waited and the page reloaded | ||
cy.wait(1000); | ||
cy.reload(); | ||
// press the centring button again after reload to stay in the correct mode | ||
cy.contains('button', '3-click centring').click(); | ||
cy.get('.form-control[name="diffractometer.phi"]') | ||
.invoke('val') | ||
.should('equal', omegaValue.toFixed(2)); | ||
}); | ||
}); | ||
}); | ||
}); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.