From 319261f15e50fca2ea292c02a502cef4fdf4c842 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Fri, 3 Jun 2016 11:38:42 +0200 Subject: [PATCH] Update gemini and docs for visual regression testing --- package.json | 3 +- test/gemini/.eslintrc.json | 3 + test/gemini/README.md | 25 +- test/gemini/tests/main/authenticated.js | 313 +++++++++--------- test/gemini/tests/main/basic.js | 1 - test/gemini/tests/main/detail.js | 135 ++++---- test/gemini/tests/whitelabel/23vivi/23vivi.js | 1 - test/gemini/tests/whitelabel/cyland/cyland.js | 1 - .../tests/whitelabel/ikonotv/ikonotv.js | 1 - .../tests/whitelabel/lumenus/lumenus.js | 1 - .../whitelabel/shared/whitelabel_basic.js | 1 - 11 files changed, 256 insertions(+), 229 deletions(-) diff --git a/package.json b/package.json index ffed0ae2..36ec9ccb 100644 --- a/package.json +++ b/package.json @@ -45,10 +45,9 @@ "chai-as-promised": "^5.1.0", "colors": "^1.1.2", "dotenv": "^1.2.0", - "gemini": "^2.1.0", + "gemini": "^4.3.0", "jest-cli": "^0.4.0", "mocha": "^2.3.4", - "phantomjs2": "^2.0.2", "rimraf": "^2.5.2", "sauce-connect-launcher": "^0.13.0", "wd": "^0.4.0" diff --git a/test/gemini/.eslintrc.json b/test/gemini/.eslintrc.json index 7d71b159..e70774e9 100644 --- a/test/gemini/.eslintrc.json +++ b/test/gemini/.eslintrc.json @@ -1,4 +1,7 @@ { + "globals": { + "gemini": true + }, "rules": { "max-len": [2, { "code": 125 }] } diff --git a/test/gemini/README.md b/test/gemini/README.md index 3521056e..d3957cdd 100644 --- a/test/gemini/README.md +++ b/test/gemini/README.md @@ -23,30 +23,41 @@ Then, install [PhantomJS2](https://www.npmjs.com/package/phantomjs2): ```bash # Until phantomjs2 is updated for the new 2.1 version of PhantomJS, use the following (go to https://bitbucket.org/ariya/phantomjs/downloads to find a build for your OS) -npm install -g phantomjs2 --phantomjs_downloadurl=https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip -npm install --save-dev phantomjs2 --phantomjs_downloadurl=https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip +npm install phantomjs2 --phantomjs_downloadurl=https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip # If using OSX, you may have to install upx and decompress the binary downloaded by npm manually: brew install upx -# Navigate to the binary, ie. /Users/Brett/.nvm/versions/node/v5.4.0/lib/node_modules/phantomjs2/lib/phantom/bin/phantomjs +# Navigate to the binary, ie. node_modules/phantomjs2/lib/phantom/bin/ (for the local installation) upx -d phantomjs +# If using Linux or OSX, you may also have to convert the binary using `dos2unix`: +brew install dos2unix +dos2unix phantomjs ``` -Finally, [install Gemini globally and locally with npm](https://github.com/gemini-testing/gemini/blob/master/README.md#installation). +Finally, [install Gemini locally with npm](https://github.com/gemini-testing/gemini/blob/master/README.md#installation), if it +hasn't already been installed through `package.json`. Running Tests ============= +Run Spool and Onion (on localhost.com:3000). + Run PhantomJS: ```bash npm run vi-phantom ``` -And then run Gemini tests: +Gather your initial baseline (on the master branch, for example): + +```bash +npm run vi-update +``` + +And then run Gemini tests (on your current branch with changes, to test for regressions): ```bash npm run vi-test @@ -61,8 +72,8 @@ npm run vi-test:whitelabel npm run vi-test:cyland ``` -If you've made changes and want them to be the new baseline (ie. it's a correct change--**make sure** to test there are -no regressions first!), use +Later on, if you've made changes and want them to be the new baseline (ie. it's a correct change--**make sure** to test +there are no regressions first!), use: ```bash npm run vi-update diff --git a/test/gemini/tests/main/authenticated.js b/test/gemini/tests/main/authenticated.js index 4e69c373..07162d75 100644 --- a/test/gemini/tests/main/authenticated.js +++ b/test/gemini/tests/main/authenticated.js @@ -1,6 +1,5 @@ 'use strict'; -const gemini = require('gemini'); const environment = require('../environment'); const MAIN_USER = environment.MAIN_USER; const TIMEOUTS = environment.TIMEOUTS; @@ -30,187 +29,191 @@ gemini.suite('Authenticated', (suite) => { actions.sendKeys(find('.ascribe-login-wrapper input[name=password]'), MAIN_USER.password); actions.click(find('.ascribe-login-wrapper button[type=submit]')); - actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); + actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.LONG); }); }); - gemini.suite('Header-desktop', (headerSuite) => { - headerSuite - .setCaptureElements('nav.navbar .container') - // Ignore Cyland's logo as it's a gif - .ignoreElements('.client--cyland img.img-brand') - .skip(/Mobile/) - .before((actions) => { - actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); - }) - .capture('desktop header'); + gemini.suite('Authenticated', (authenticatedSuite) => { + gemini.suite('Header-desktop', (headerSuite) => { + headerSuite + .setCaptureElements('nav.navbar .container') + // Ignore Cyland's logo as it's a gif + .ignoreElements('.client--cyland img.img-brand') + .skip(/Mobile/) + .before((actions) => { + actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.LONG); + actions.waitForElementToShow('#header-notification-dropdown', TIMEOUTS.SUPER_DUPER_EXTRA_LONG); + }) + .capture('desktop header'); - gemini.suite('User dropdown', (headerUserSuite) => { - headerUserSuite - .setCaptureElements('#nav-route-user-dropdown ~ .dropdown-menu') - .capture('expanded user dropdown', (actions, find) => { - actions.click(find('#nav-route-user-dropdown')); - }); + gemini.suite('User dropdown', (headerUserSuite) => { + headerUserSuite + .setCaptureElements('#nav-route-user-dropdown ~ .dropdown-menu') + .capture('expanded user dropdown', (actions, find) => { + actions.click(find('#nav-route-user-dropdown')); + }); + }); + + gemini.suite('Notification dropdown', (headerNotificationSuite) => { + headerNotificationSuite + .setCaptureElements('#header-notification-dropdown ~ .dropdown-menu') + .capture('expanded notifications dropdown', (actions, find) => { + actions.click(find('#header-notification-dropdown')); + }); + }); }); - gemini.suite('Notification dropdown', (headerNotificationSuite) => { - headerNotificationSuite - .setCaptureElements('#header-notification-dropdown ~ .dropdown-menu') + // Test for the collapsed header in mobile + gemini.suite('Header-mobile', (headerMobileSuite) => { + headerMobileSuite + .setCaptureElements('nav.navbar .container') + // Ignore Cyland's logo as it's a gif + .ignoreElements('.client--cyland img.img-brand') + .skip(/Desktop/) + .before((actions) => { + actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.LONG); + }) + .capture('mobile header') + .capture('expanded mobile header', (actions, find) => { + actions.click(find('nav.navbar .navbar-toggle')); + // Wait for the header to expand + actions.wait(500); + actions.waitForElementToShow('#header-notification-dropdown', TIMEOUTS.SUPER_DUPER_EXTRA_LONG); + }) + .capture('expanded user dropdown', (actions, find) => { + actions.click(find('#nav-route-user-dropdown')); + }) .capture('expanded notifications dropdown', (actions, find) => { actions.click(find('#header-notification-dropdown')); }); }); - }); - // Test for the collapsed header in mobile - gemini.suite('Header-mobile', (headerMobileSuite) => { - headerMobileSuite - .setCaptureElements('nav.navbar .container') - // Ignore Cyland's logo as it's a gif - .ignoreElements('.client--cyland img.img-brand') - .skip(/Desktop/) - .before((actions) => { - actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); - }) - .capture('mobile header') - .capture('expanded mobile header', (actions, find) => { - actions.click(find('nav.navbar .navbar-toggle')); - // Wait for the header to expand - actions.wait(500); - }) - .capture('expanded user dropdown', (actions, find) => { - actions.click(find('#nav-route-user-dropdown')); - }) - .capture('expanded notifications dropdown', (actions, find) => { - actions.click(find('#header-notification-dropdown')); - }); - }); - - gemini.suite('Collection', (collectionSuite) => { - collectionSuite - .setCaptureElements('.ascribe-accordion-list') - .before((actions) => { - actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); - // Wait for the images to load - // FIXME: unfortuntately gemini doesn't support ignoring multiple elements from a single selector - // so we're forced to wait and hope that the images will all finish loading after 5s. - // We could also change the thumbnails with JS, but setting up a test user is probably easier. - actions.wait(TIMEOUTS.NORMAL); - }) - .capture('collection') - .capture('expanded edition in collection', (actions, find) => { - actions.click(find('.ascribe-accordion-list-item .ascribe-accordion-list-item-edition-widget')); - // Wait for editions to load - actions.waitForElementToShow('.ascribe-accordion-list-item-table', TIMEOUTS.LONG); - }); - - gemini.suite('Collection placeholder', (collectionPlaceholderSuite) => { - collectionPlaceholderSuite - .setCaptureElements('.ascribe-accordion-list-placeholder') - .capture('collection empty search', (actions, find) => { - actions.sendKeys(find('.ascribe-piece-list-toolbar .search-bar input[type="text"]'), 'no search result'); - actions.waitForElementToShow('.ascribe-accordion-list-placeholder', TIMEOUTS.NORMAL); - }); - }); - - gemini.suite('PieceListBulkModal', (pieceListBulkModalSuite) => { - pieceListBulkModalSuite - .setCaptureElements('.piece-list-bulk-modal') - .capture('items selected', (actions, find) => { + gemini.suite('Collection', (collectionSuite) => { + collectionSuite + .setCaptureElements('.ascribe-accordion-list') + .before((actions) => { + actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); + // Wait for the images to load + // FIXME: unfortuntately gemini doesn't support ignoring multiple elements from a single selector + // so we're forced to wait and hope that the images will all finish loading after 5s. + // We could also change the thumbnails with JS, but setting up a test user is probably easier. + actions.wait(TIMEOUTS.NORMAL); + }) + .capture('collection') + .capture('expanded edition in collection', (actions, find) => { actions.click(find('.ascribe-accordion-list-item .ascribe-accordion-list-item-edition-widget')); // Wait for editions to load - actions.waitForElementToShow('.ascribe-accordion-list-item-table', TIMEOUTS.NORMAL); - - actions.click('.ascribe-table thead tr input[type="checkbox"]'); - actions.waitForElementToShow('.piece-list-bulk-modal'); + actions.waitForElementToShow('.ascribe-accordion-list-item-table', TIMEOUTS.LONG); }); - }); - }); - gemini.suite('PieceListToolbar', (pieceListToolbarSuite) => { - pieceListToolbarSuite - .setCaptureElements('.ascribe-piece-list-toolbar') - .capture('piece list toolbar') - .capture('piece list toolbar search filled', (actions, find) => { - actions.sendKeys(find('.ascribe-piece-list-toolbar .search-bar input[type="text"]'), 'search text'); - actions.waitForElementToShow('.ascribe-piece-list-toolbar .search-bar .icon-ascribe-search', - TIMEOUTS.NORMAL); + gemini.suite('Collection placeholder', (collectionPlaceholderSuite) => { + collectionPlaceholderSuite + .setCaptureElements('.ascribe-accordion-list-placeholder') + .capture('collection empty search', (actions, find) => { + actions.sendKeys(find('.ascribe-piece-list-toolbar .search-bar input[type="text"]'), 'no search result'); + actions.waitForElementToShow('.ascribe-accordion-list-placeholder', TIMEOUTS.NORMAL); + }); }); - gemini.suite('Order widget dropdown', (pieceListToolbarOrderWidgetSuite) => { - pieceListToolbarOrderWidgetSuite - .setCaptureElements('#ascribe-piece-list-toolbar-order-widget-dropdown', - '#ascribe-piece-list-toolbar-order-widget-dropdown ~ .dropdown-menu') - .capture('expanded order dropdown', (actions, find) => { - actions.click(find('#ascribe-piece-list-toolbar-order-widget-dropdown')); + gemini.suite('PieceListBulkModal', (pieceListBulkModalSuite) => { + pieceListBulkModalSuite + .setCaptureElements('.piece-list-bulk-modal') + .capture('items selected', (actions, find) => { + actions.click(find('.ascribe-accordion-list-item .ascribe-accordion-list-item-edition-widget')); + // Wait for editions to load + actions.waitForElementToShow('.ascribe-accordion-list-item-table', TIMEOUTS.NORMAL); - // Wait as the dropdown screenshot still includes the collection in the background - actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); - }); + actions.click('.ascribe-table thead tr input[type="checkbox"]'); + actions.waitForElementToShow('.piece-list-bulk-modal'); + }); + }); }); - gemini.suite('Filter widget dropdown', (pieceListToolbarFilterWidgetSuite) => { - pieceListToolbarFilterWidgetSuite - .setCaptureElements('#ascribe-piece-list-toolbar-filter-widget-dropdown', - '#ascribe-piece-list-toolbar-filter-widget-dropdown ~ .dropdown-menu') - .capture('expanded filter dropdown', (actions, find) => { - actions.click(find('#ascribe-piece-list-toolbar-filter-widget-dropdown')); - - // Wait as the dropdown screenshot still includes the collection in the background - actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); + gemini.suite('PieceListToolbar', (pieceListToolbarSuite) => { + pieceListToolbarSuite + .setCaptureElements('.ascribe-piece-list-toolbar') + .capture('piece list toolbar') + .capture('piece list toolbar search filled', (actions, find) => { + actions.sendKeys(find('.ascribe-piece-list-toolbar .search-bar input[type="text"]'), 'search text'); + actions.waitForElementToShow('.ascribe-piece-list-toolbar .search-bar .icon-ascribe-search', + TIMEOUTS.NORMAL); }); - }); - }); - gemini.suite('Register work', (registerSuite) => { - registerSuite - .setUrl('/register_piece') - .before((actions) => { - // The editions options are only rendered after the whitelabel is fetched, so - // we have to wait for it here - // We have to check for the sibling checkbox class as the input itself is hidden - actions.waitForElementToShow('.ascribe-form input[name="num_editions-checkbox"] ~ .checkbox', - TIMEOUTS.NORMAL); - }) - .capture('register work', (actions) => { - // The uploader options are only rendered after the user is fetched, so - // we also have to wait for it here - actions.waitForElementToShow('.file-drag-and-drop-dialog .present-options', TIMEOUTS.NORMAL); - }) - .capture('register work filled', (actions, find) => { - actions.sendKeys(find('.ascribe-form input[name="artist_name"]'), 'artist name'); - actions.sendKeys(find('.ascribe-form input[name="title"]'), 'title'); - actions.sendKeys(find('.ascribe-form input[name="date_created"]'), 'date created'); - }) - .capture('register work filled with editions', (actions, find) => { - actions.click(find('.ascribe-form input[name="num_editions-checkbox"] ~ .checkbox')); - // Wait for transition - actions.wait(500); - actions.sendKeys(find('.ascribe-form input[name="num_editions"]'), '50'); + gemini.suite('Order widget dropdown', (pieceListToolbarOrderWidgetSuite) => { + pieceListToolbarOrderWidgetSuite + .setCaptureElements('#ascribe-piece-list-toolbar-order-widget-dropdown', + '#ascribe-piece-list-toolbar-order-widget-dropdown ~ .dropdown-menu') + .capture('expanded order dropdown', (actions, find) => { + actions.click(find('#ascribe-piece-list-toolbar-order-widget-dropdown')); + + // Wait as the dropdown screenshot still includes the collection in the background + actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); + }); }); - gemini.suite('Register work hash', (registerHashSuite) => { - registerHashSuite - .setUrl('/register_piece?method=hash') - .capture('register work hash method'); + gemini.suite('Filter widget dropdown', (pieceListToolbarFilterWidgetSuite) => { + pieceListToolbarFilterWidgetSuite + .setCaptureElements('#ascribe-piece-list-toolbar-filter-widget-dropdown', + '#ascribe-piece-list-toolbar-filter-widget-dropdown ~ .dropdown-menu') + .capture('expanded filter dropdown', (actions, find) => { + actions.click(find('#ascribe-piece-list-toolbar-filter-widget-dropdown')); + + // Wait as the dropdown screenshot still includes the collection in the background + actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); + }); + }); }); - gemini.suite('Register work upload', (registerUploadSuite) => { - registerUploadSuite - .setUrl('/register_piece?method=upload') - .capture('register work upload method'); - }); - }); + gemini.suite('Register work', (registerSuite) => { + registerSuite + .setUrl('/register_piece') + .before((actions) => { + // The editions options are only rendered after the whitelabel is fetched, so + // we have to wait for it here + // We have to check for the sibling checkbox class as the input itself is hidden + actions.waitForElementToShow('.ascribe-form input[name="num_editions-checkbox"] ~ .checkbox', + TIMEOUTS.NORMAL); + }) + .capture('register work', (actions) => { + // The uploader options are only rendered after the user is fetched, so + // we also have to wait for it here + actions.waitForElementToShow('.file-drag-and-drop-dialog .present-options', TIMEOUTS.NORMAL); + }) + .capture('register work filled', (actions, find) => { + actions.sendKeys(find('.ascribe-form input[name="artist_name"]'), 'artist name'); + actions.sendKeys(find('.ascribe-form input[name="title"]'), 'title'); + actions.sendKeys(find('.ascribe-form input[name="date_created"]'), 'date created'); + }) + .capture('register work filled with editions', (actions, find) => { + actions.click(find('.ascribe-form input[name="num_editions-checkbox"] ~ .checkbox')); + // Wait for transition + actions.wait(500); + actions.sendKeys(find('.ascribe-form input[name="num_editions"]'), '50'); + }); - gemini.suite('User settings', (userSettingsSuite) => { - userSettingsSuite - .setUrl('/settings') - .before((actions) => { - // This will be called before every nested suite begins unless that suite - // also defines a `.before()` - actions.waitForElementToShow('.settings-container', TIMEOUTS.NORMAL); - }) - .capture('user settings'); + gemini.suite('Register work hash', (registerHashSuite) => { + registerHashSuite + .setUrl('/register_piece?method=hash') + .capture('register work hash method'); + }); + + gemini.suite('Register work upload', (registerUploadSuite) => { + registerUploadSuite + .setUrl('/register_piece?method=upload') + .capture('register work upload method'); + }); + }); + + gemini.suite('User settings', (userSettingsSuite) => { + userSettingsSuite + .setUrl('/settings') + .before((actions) => { + // This will be called before every nested suite begins unless that suite + // also defines a `.before()` + actions.waitForElementToShow('.settings-container', TIMEOUTS.NORMAL); + }) + .capture('user settings'); + }); }); // Suite just to log out after suites have run diff --git a/test/gemini/tests/main/basic.js b/test/gemini/tests/main/basic.js index 0063594a..4437ce53 100644 --- a/test/gemini/tests/main/basic.js +++ b/test/gemini/tests/main/basic.js @@ -1,6 +1,5 @@ 'use strict'; -const gemini = require('gemini'); const environment = require('../environment'); const MAIN_USER = environment.MAIN_USER; const TIMEOUTS = environment.TIMEOUTS; diff --git a/test/gemini/tests/main/detail.js b/test/gemini/tests/main/detail.js index c2d256b4..3d2b0e87 100644 --- a/test/gemini/tests/main/detail.js +++ b/test/gemini/tests/main/detail.js @@ -1,6 +1,5 @@ 'use strict'; -const gemini = require('gemini'); const environment = require('../environment'); const MAIN_USER = environment.MAIN_USER; const TIMEOUTS = environment.TIMEOUTS; @@ -13,12 +12,10 @@ const editionUrl = `/editions/${environment.MAIN_EDITION_ID}`; * Tests include accessing the piece / edition as the owner or as another user * (we can just use an anonymous user in this case). */ -gemini.suite('Work detail', (suite) => { +gemini.suite('Basic work detail', (suite) => { suite .setCaptureElements('.ascribe-body') .before((actions) => { - // This will be called before every nested suite begins unless that suite - // also defines a `.before()` actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL); // Wait for the social media buttons to appear @@ -51,78 +48,97 @@ gemini.suite('Work detail', (suite) => { .setUrl(editionUrl) .capture('basic edition'); }); +}); + +gemini.suite('Authenticated work detail', (suite) => { + suite + .setCaptureElements('.ascribe-body') + .before((actions) => { + actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL); + }); - // Suite just to log us in before any other suites run gemini.suite('Login', (loginSuite) => { loginSuite .setUrl('/login') .ignoreElements('.ascribe-body') - .before((actions) => { - actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL); - }) .capture('logged in', (actions, find) => { + console.log('logging in'); actions.sendKeys(find('.ascribe-login-wrapper input[name=email]'), MAIN_USER.email); actions.sendKeys(find('.ascribe-login-wrapper input[name=password]'), MAIN_USER.password); actions.click(find('.ascribe-login-wrapper button[type=submit]')); - actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.NORMAL); + actions.waitForElementToShow('.ascribe-accordion-list:not(.ascribe-loading-position)', TIMEOUTS.LONG); }); }); - gemini.suite('Authorized piece', (authorizedPieceSuite) => { - authorizedPieceSuite - .setUrl(pieceUrl) - .capture('authorized piece'); - }); - - gemini.suite('Authorized edition', (authorizedEditionSuite) => { - authorizedEditionSuite - .setUrl(editionUrl) - .capture('authorized edition'); - }); - - gemini.suite('Detail action buttons', (detailActionButtonSuite) => { - detailActionButtonSuite - .setUrl(editionUrl) - .capture('hover on action button', (actions, find) => { - actions.mouseMove(find('.ascribe-detail-property .ascribe-button-list button.btn-default')); - }) - .capture('hover on delete button', (actions, find) => { - actions.mouseMove(find('.ascribe-detail-property .ascribe-button-list button.btn-tertiary')); - }) - .capture('hover on info button', (actions, find) => { - actions.mouseMove(find('.ascribe-detail-property .ascribe-button-list button.glyphicon-question-sign')); - }) - .capture('expand info text', (actions, find) => { - actions.click(find('.ascribe-detail-property .ascribe-button-list button.glyphicon-question-sign')); + gemini.suite('Authenticated', (authenticatedSuite) => { + authenticatedSuite + .before((actions) => { + // Wait for the social media buttons to appear + actions.waitForElementToShow('.ascribe-social-button-list .fb-share-button iframe', + TIMEOUTS.SUPER_DUPER_EXTRA_LONG); + actions.waitForElementToShow('.ascribe-social-button-list .twitter-share-button', + TIMEOUTS.SUPER_DUPER_EXTRA_LONG); + actions.waitForElementToShow('.ascribe-media-player', TIMEOUTS.LONG); }); - }); - gemini.suite('Action form modal', (actionFormModalSuite) => { - actionFormModalSuite - .setUrl(editionUrl) - .setCaptureElements('.modal-dialog') - .capture('open email form', (actions, find) => { - // Add class names to make the action buttons easier to select - // eslint-disable-next-line prefer-arrow-callback - actions.executeJS(function addButtonTypeAsClass(window) { - /* eslint-disable no-var, prefer-template */ - var actionButtonsSelector = '.ascribe-detail-property .ascribe-button-list button.btn-default'; - var actionButtons = window.document.querySelectorAll(actionButtonsSelector); - var ii = 0; - for (; ii < actionButtons.length; ++ii) { - if (actionButtons[ii].textContent) { - actionButtons[ii].className += ' ascribe-action-button-' + - actionButtons[ii].textContent.toLowerCase(); - } - } - /* eslint-enable no-var */ + gemini.suite('Authorized piece', (authorizedPieceSuite) => { + console.log('authorized piece'); + authorizedPieceSuite + .setUrl(pieceUrl) + .capture('authorized piece'); + }); + + gemini.suite('Authorized edition', (authorizedEditionSuite) => { + authorizedEditionSuite + .setUrl(editionUrl) + .capture('authorized edition'); + }); + + gemini.suite('Detail action buttons', (detailActionButtonSuite) => { + detailActionButtonSuite + .setUrl(editionUrl) + .capture('hover on action button', (actions, find) => { + console.log('hover on action button'); + actions.mouseMove(find('.ascribe-detail-property .ascribe-button-list button.btn-default')); + }) + .capture('hover on delete button', (actions, find) => { + actions.mouseMove(find('.ascribe-detail-property .ascribe-button-list button.btn-tertiary')); + }) + .capture('hover on info button', (actions, find) => { + actions.mouseMove(find('.ascribe-detail-property .ascribe-button-list button.glyphicon-question-sign')); + }) + .capture('expand info text', (actions, find) => { + actions.click(find('.ascribe-detail-property .ascribe-button-list button.glyphicon-question-sign')); }); - actions.click(find('.ascribe-detail-property .ascribe-button-list button.ascribe-action-button-email')); + }); - // Wait for transition - actions.wait(1000); - }); + gemini.suite('Action form modal', (actionFormModalSuite) => { + actionFormModalSuite + .setUrl(editionUrl) + .setCaptureElements('.modal-dialog') + .capture('open email form', (actions, find) => { + // Add class names to make the action buttons easier to select + // eslint-disable-next-line prefer-arrow-callback + actions.executeJS(function addButtonTypeAsClass(window) { + /* eslint-disable no-var, prefer-template */ + var actionButtonsSelector = '.ascribe-detail-property .ascribe-button-list button.btn-default'; + var actionButtons = window.document.querySelectorAll(actionButtonsSelector); + var ii = 0; + for (; ii < actionButtons.length; ++ii) { + if (actionButtons[ii].textContent) { + actionButtons[ii].className += ' ascribe-action-button-' + + actionButtons[ii].textContent.toLowerCase(); + } + } + /* eslint-enable no-var */ + }); + actions.click(find('.ascribe-detail-property .ascribe-button-list button.ascribe-action-button-email')); + + // Wait for transition + actions.wait(1000); + }); + }); }); // Suite just to log out after suites have run @@ -131,6 +147,7 @@ gemini.suite('Work detail', (suite) => { .setUrl('/logout') .ignoreElements('.ascribe-body') .before((actions) => { + console.log('before log out'); actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL); }) .capture('logout', (actions) => { diff --git a/test/gemini/tests/whitelabel/23vivi/23vivi.js b/test/gemini/tests/whitelabel/23vivi/23vivi.js index 6fb34856..17c53358 100644 --- a/test/gemini/tests/whitelabel/23vivi/23vivi.js +++ b/test/gemini/tests/whitelabel/23vivi/23vivi.js @@ -1,6 +1,5 @@ 'use strict'; -const gemini = require('gemini'); const environment = require('../../environment'); const TIMEOUTS = environment.TIMEOUTS; diff --git a/test/gemini/tests/whitelabel/cyland/cyland.js b/test/gemini/tests/whitelabel/cyland/cyland.js index 7f23034e..5939a73c 100644 --- a/test/gemini/tests/whitelabel/cyland/cyland.js +++ b/test/gemini/tests/whitelabel/cyland/cyland.js @@ -1,6 +1,5 @@ 'use strict'; -const gemini = require('gemini'); const environment = require('../../environment'); const TIMEOUTS = environment.TIMEOUTS; diff --git a/test/gemini/tests/whitelabel/ikonotv/ikonotv.js b/test/gemini/tests/whitelabel/ikonotv/ikonotv.js index 4fff539b..5616a32c 100644 --- a/test/gemini/tests/whitelabel/ikonotv/ikonotv.js +++ b/test/gemini/tests/whitelabel/ikonotv/ikonotv.js @@ -1,6 +1,5 @@ 'use strict'; -const gemini = require('gemini'); const environment = require('../../environment'); const MAIN_USER = environment.MAIN_USER; const TIMEOUTS = environment.TIMEOUTS; diff --git a/test/gemini/tests/whitelabel/lumenus/lumenus.js b/test/gemini/tests/whitelabel/lumenus/lumenus.js index b4c52d35..6245b03b 100644 --- a/test/gemini/tests/whitelabel/lumenus/lumenus.js +++ b/test/gemini/tests/whitelabel/lumenus/lumenus.js @@ -1,6 +1,5 @@ 'use strict'; -const gemini = require('gemini'); const environment = require('../../environment'); const TIMEOUTS = environment.TIMEOUTS; diff --git a/test/gemini/tests/whitelabel/shared/whitelabel_basic.js b/test/gemini/tests/whitelabel/shared/whitelabel_basic.js index 874c85ea..df997513 100644 --- a/test/gemini/tests/whitelabel/shared/whitelabel_basic.js +++ b/test/gemini/tests/whitelabel/shared/whitelabel_basic.js @@ -1,6 +1,5 @@ 'use strict'; -const gemini = require('gemini'); const environment = require('../../environment'); const MAIN_USER = environment.MAIN_USER; const TIMEOUTS = environment.TIMEOUTS;