From c84fa887593b6ba391353287f08609f367b552c5 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Thu, 6 Sep 2018 15:25:46 +0200 Subject: [PATCH] :white_check_mark: Ajoute un test end to end pour l'integration de l'iframe --- cypress/integration/.eslintrc.yaml | 1 + cypress/integration/embauche/iframe.js | 14 ++++++++++++++ cypress/integration/embauche/landing.js | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 cypress/integration/embauche/iframe.js diff --git a/cypress/integration/.eslintrc.yaml b/cypress/integration/.eslintrc.yaml index bd8da2fec..e5a3c1494 100644 --- a/cypress/integration/.eslintrc.yaml +++ b/cypress/integration/.eslintrc.yaml @@ -1,2 +1,3 @@ globals: cy: false + Cypress: false diff --git a/cypress/integration/embauche/iframe.js b/cypress/integration/embauche/iframe.js new file mode 100644 index 000000000..a39e6c5d6 --- /dev/null +++ b/cypress/integration/embauche/iframe.js @@ -0,0 +1,14 @@ +Cypress.Commands.add('iframe', { prevSubject: 'element' }, $iframe => { + return new Cypress.Promise(resolve => { + setTimeout(() => resolve($iframe.contents().find('body')), 5000) + }) +}) + +describe('Iframe integration test', function() { + it('should display an iframe of the simulateur', function() { + cy.visit('/integration-test') + cy.get('iframe') + .iframe() + .contains('Entrez un salaire mensuel') + }) +}) diff --git a/cypress/integration/embauche/landing.js b/cypress/integration/embauche/landing.js index 18fd540ba..c7f81ef38 100644 --- a/cypress/integration/embauche/landing.js +++ b/cypress/integration/embauche/landing.js @@ -7,7 +7,7 @@ const salaryInput = inputTitle => { return inputContainer.find('input') } describe('Landing basic test', function() { - it('should not crash when entering salary', function() { + it('should not crash', function() { cy.visit('/') }) it('should display the simulateur after loading', function() {