Unify solution e2e tests
This commit is contained in:
parent
84324f9f7c
commit
b01802153e
|
|
@ -1,23 +1,12 @@
|
|||
describe('Solutions', () => {
|
||||
it('does not display the solution at first, then displays them after clicking', () => {
|
||||
cy.viewport('macbook-15');
|
||||
cy.login('nico.zickgraf', 'test');
|
||||
// it('does not display the solution at first, then displays them after clicking', () => {
|
||||
// cy.viewport('macbook-15');
|
||||
// cy.login('nico.zickgraf', 'test');
|
||||
//
|
||||
// cy.visit('/module/lohn-und-budget');
|
||||
// });
|
||||
|
||||
cy.visit('/module/lohn-und-budget');
|
||||
cy.get('[data-cy=solution]').first()
|
||||
.should('contain', 'anzeigen')
|
||||
.should('not.contain', 'Lösungssatz')
|
||||
.then($solution => {
|
||||
cy.wrap($solution).within(() => {
|
||||
cy.get('[data-cy=show-solution]').click();
|
||||
});
|
||||
cy.wrap($solution)
|
||||
.should('contain', 'Lösungssatz')
|
||||
.should('contain', 'ausblenden');
|
||||
});
|
||||
});
|
||||
|
||||
it.only('toggles the solution as teacher', () => {
|
||||
it('toggles the solution as teacher, then the student can display it', () => {
|
||||
// cy.server();
|
||||
cy.login('nico.zickgraf', 'test');
|
||||
cy.visit('/module/lohn-und-budget');
|
||||
|
|
@ -49,7 +38,19 @@ describe('Solutions', () => {
|
|||
|
||||
cy.login('rahel.cueni', 'test');
|
||||
cy.visit('/module/lohn-und-budget');
|
||||
cy.get('[data-cy=solution]').should('exist');
|
||||
// cy.get('[data-cy=solution]').should('exist');
|
||||
cy.get('[data-cy=solution]').first()
|
||||
.should('contain', 'anzeigen')
|
||||
.should('not.contain', 'Lösungssatz')
|
||||
.then($solution => {
|
||||
cy.wrap($solution).within(() => {
|
||||
cy.get('[data-cy=show-solution]').click();
|
||||
});
|
||||
cy.wrap($solution)
|
||||
.should('contain', 'Lösungssatz')
|
||||
.should('contain', 'ausblenden');
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue