From 799bf76a86553df0004a4b1afc6b17a53b56089e Mon Sep 17 00:00:00 2001 From: juliandescottes Date: Tue, 9 May 2017 01:20:57 +0200 Subject: [PATCH] update integration tests after selectMode step changes --- .../settings/test-import-image-twice.js | 20 +++++-------------- .../integration/settings/test-import-image.js | 20 ++----------------- 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/test/casperjs/integration/settings/test-import-image-twice.js b/test/casperjs/integration/settings/test-import-image-twice.js index 2ff5989c..38c768b4 100644 --- a/test/casperjs/integration/settings/test-import-image-twice.js +++ b/test/casperjs/integration/settings/test-import-image-twice.js @@ -1,7 +1,7 @@ /* globals casper, setPiskelFromGrid, isDrawerExpanded, getValue, isChecked, evalLine, waitForEvent, replaceFunction, setPiskelFromImageSrc */ -casper.test.begin('Double Image import test', 29, function(test) { +casper.test.begin('Double Image import test', 25, function(test) { test.timeout = test.fail.bind(test, ['Test timed out']); // Helper to retrieve the text content of the provided selector @@ -109,13 +109,8 @@ casper.test.begin('Double Image import test', 29, function(test) { function onSelectModeReady() { casper.echo('Select Mode step is displayed'); - test.assertEquals(evalLine('document.querySelector("#select-mode-replace").checked'), true, - 'The default import mode is the REPLACE mode'); - test.assertEquals(getTextContent('.import-next-button'), 'import', - 'Next button found and has the expected text content (import)'); - - casper.echo('Click on next-button and wait for popup to close'); - casper.click('.current-step .import-next-button'); + casper.echo('Click on replace-button and wait for popup to close'); + casper.click('.current-step .import-mode-replace-button'); casper.waitForSelector('#dialog-container-wrapper:not(.show)', onPopupClosed, test.timeout, 10000); } @@ -172,13 +167,8 @@ casper.test.begin('Double Image import test', 29, function(test) { function onSelectModeReady2() { casper.echo('Select Mode step is displayed (again)'); - test.assertEquals(evalLine('document.querySelector("#select-mode-replace").checked'), true, - 'The default import mode is the REPLACE mode'); - test.assertEquals(getTextContent('.import-next-button'), 'import', - 'Next button found and has the expected text content (import)'); - - casper.echo('Click on next-button and wait for popup to close'); - casper.click('.current-step .import-next-button'); + casper.echo('Click on replace-button and wait for popup to close'); + casper.click('.current-step .import-mode-replace-button'); casper.waitForSelector('#dialog-container-wrapper:not(.show)', onPopupClosed2, test.timeout, 10000); } diff --git a/test/casperjs/integration/settings/test-import-image.js b/test/casperjs/integration/settings/test-import-image.js index db562c97..ddd16bba 100644 --- a/test/casperjs/integration/settings/test-import-image.js +++ b/test/casperjs/integration/settings/test-import-image.js @@ -1,7 +1,7 @@ /* globals casper, setPiskelFromGrid, isDrawerExpanded, getValue, isChecked, evalLine, waitForEvent, replaceFunction, setPiskelFromImageSrc */ -casper.test.begin('Simple Image import test', 29, function(test) { +casper.test.begin('Simple Image import test', 26, function(test) { test.timeout = test.fail.bind(test, ['Test timed out']); // Helper to retrieve the text content of the provided selector @@ -102,24 +102,8 @@ casper.test.begin('Simple Image import test', 29, function(test) { casper.echo('Select Mode step is displayed'); checkImportPreview(test); - test.assertEquals(evalLine('document.querySelector("#select-mode-replace").checked'), true, - 'The default import mode is the REPLACE mode'); - test.assertEquals(getTextContent('.import-next-button'), 'import', - 'Next button found and has the expected text content (import)'); - - // Click on export again to close the settings drawer. - casper.echo('Click on merge mode and wait for the next-button text to update'); - casper.waitForSelectorTextChange('.current-step .import-next-button', onModeSelected, test.timeout, 10000); - casper.click('#select-mode-merge'); - } - - function onModeSelected() { - casper.echo('New mode was selected, check that the text of the next-button now reads "next"'); - test.assertEquals(getTextContent('.import-next-button'), 'next', - 'Next button found and has the expected text content (next) '); - casper.echo('Go to next step (adjust size)'); - casper.click('.current-step .import-next-button'); + casper.click('.current-step .import-mode-merge-button'); casper.waitForSelector('.current-step .import-resize-info', onAdjustSizeReady, test.timeout, 10000); }