Skip to content

Commit

Permalink
Remove an extra login which could be causing unstable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
boryanagoncharenko committed Jan 30, 2025
1 parent 88fa944 commit d87ba3c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/cypress/e2e/public_programs/view_programs.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@ import { login, logout } from "../tools/login/login"
import { codeMirrorContent } from "../tools/programs/program";

describe('Tests for viewing programs', () => {
beforeEach(()=> {
login('user2', '123456'); // user2 has Dutch language set
// And we are accessing programs written by user1, that has French set
})
it('Seeing a program that contains an error in a different language, shouldnt result in a crash', () => {
login('user1', '123456')
login('user1', '123456') // the language of user1 is French
cy.visit('/hedy/fb23d0fa90ce48b5bf87c0632969fc28/view')
codeMirrorContent().should('have.text', 'répète 1 foistourne 3 avance 50');
logout()
login('user2', '123456')
login('user2', '123456') // the language of user1 is Dutch
cy.url().should('eq', Cypress.config('baseUrl') + '/', {timeout: 10000})
cy.visit('/hedy/fb23d0fa90ce48b5bf87c0632969fc28/view')
codeMirrorContent().should('have.text', 'répète 1 foistourne 3 avance 50');
})

it("We can translate from any two languages that dont involve english", () => {
login('user1', '123456')
login('user1', '123456') // the language of user1 is French
cy.visit('/hedy/4386f49502344c5cb915b37acb959a27/view')
codeMirrorContent().should('have.text', 'répète 5 fois affiche "Salut tout le monde" affiche"Tout ceci sera répété 5 fois"');
logout()
login('user2', '123456')
login('user2', '123456') // the language of user1 is Dutch
cy.url().should('eq', Cypress.config('baseUrl') + '/', {timeout: 10000})
cy.visit('/hedy/4386f49502344c5cb915b37acb959a27/view')
codeMirrorContent().should('have.text', 'herhaal 5 keer print "Salut tout le monde" print"Tout ceci sera répété 5 fois"');
})
})
})

0 comments on commit d87ba3c

Please sign in to comment.