From 2e34f726ebc967658e712d6cee31df98a77de3be Mon Sep 17 00:00:00 2001 From: David Jay Date: Thu, 26 Jan 2017 14:41:03 -0500 Subject: [PATCH] Updating tests to reflect graphql changes. --- nightwatch.conf.js | 12 ++++++------ scripts/pree2e.sh | 4 ++-- test/e2e/mocks.js | 14 ++++++++------ test/e2e/pages/embedStreamPage.js | 4 ++-- test/e2e/tests/EmbedStreamTests.js | 2 +- test/e2e/tests/Visitor/SignUpTest.js | 2 +- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/nightwatch.conf.js b/nightwatch.conf.js index fb6c5f9c7..c2653e714 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -1,20 +1,20 @@ require('babel-core/register'); module.exports = { - 'src_folders': './tests/e2e/tests', - 'output_folder': './tests/e2e/reports', - 'page_objects_path': './tests/e2e/pages', - 'globals_path': './tests/e2e/globals', + 'src_folders': './test/e2e/tests', + 'output_folder': './test/e2e/reports', + 'page_objects_path': './test/e2e/pages', + 'globals_path': './test/e2e/globals', 'custom_commands_path' : '', 'custom_assertions_path' : '', 'selenium': { 'start_process': true, 'server_path': 'node_modules/selenium-standalone/.selenium/selenium-server/2.53.1-server.jar', - 'log_path': './tests/e2e/reports', + 'log_path': './test/e2e/reports', 'host': '127.0.0.1', 'port': 6666, 'cli_args': { - 'webdriver.chrome.driver': 'node_modules/selenium-standalone/.selenium/chromedriver/2.25-x64-chromedriver' + 'webdriver.chrome.driver': 'node_modules/selenium-standalone/.selenium/chromedriver/2.27-x64-chromedriver' } }, 'test_settings': { diff --git a/scripts/pree2e.sh b/scripts/pree2e.sh index 267a2617f..f9caae85d 100755 --- a/scripts/pree2e.sh +++ b/scripts/pree2e.sh @@ -4,10 +4,10 @@ selenium-standalone install # Creating Admin Test User -./bin/cli users create --flag_mode --email "admin@test.com" --password "testtest" --name "AdminTestUser" --role "admin" +./bin/cli users create --flag_mode --email "admin@test.com" --password "testtest" --name "AdminTestUser" --role "ADMIN" # Creating Moderator Test User -./bin/cli users create --flag_mode --email "moderator@test.com" --password "testtest" --name "ModeratorTestUser" --role "moderator" +./bin/cli users create --flag_mode --email "moderator@test.com" --password "testtest" --name "ModeratorTestUser" --role "MODERATOR" # Creating Commenter Test User ./bin/cli users create --flag_mode --email "commenter@test.com" --password "testtest" --name "CommenterTestUser" diff --git a/test/e2e/mocks.js b/test/e2e/mocks.js index a4f430cd5..e46077308 100644 --- a/test/e2e/mocks.js +++ b/test/e2e/mocks.js @@ -1,8 +1,8 @@ -const Comments = require('../../models/comment'); -const Users = require('../../models/user'); -const Actions = require('../../models/action'); -const Assets = require('../../models/asset'); -const Settings = require('../../models/setting'); +const Comments = require('../../services/comments'); +const Users = require('../../services/users'); +const Actions = require('../../services/actions'); +const Assets = require('../../services/assets'); +const Settings = require('../../services/settings'); const globals = require('./globals'); /* Create an array of comments */ @@ -22,4 +22,6 @@ module.exports.users = (users) => Users.createLocalUsers(users); module.exports.actions = (actions) => Actions.create(actions); /* Update a setting */ -module.exports.settings = (setting) => Settings.init().then(() => Settings.updateSettings(setting)); +module.exports.settings = (setting) => Settings.init().then(() => { + Settings.updateSettings(setting); +}); diff --git a/test/e2e/pages/embedStreamPage.js b/test/e2e/pages/embedStreamPage.js index 164449ff0..bdf2f9440 100644 --- a/test/e2e/pages/embedStreamPage.js +++ b/test/e2e/pages/embedStreamPage.js @@ -127,10 +127,10 @@ module.exports = { selector: '.comment .coral-plugin-flags-popup' }, flagCommentOption: { - selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="comments"]' + selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="COMMENTS"]' }, flagUsernameOption: { - selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="user"]' + selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="USERS"]' }, flagOtherOption: { selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="other"]' diff --git a/test/e2e/tests/EmbedStreamTests.js b/test/e2e/tests/EmbedStreamTests.js index abe76fed3..93bb54399 100644 --- a/test/e2e/tests/EmbedStreamTests.js +++ b/test/e2e/tests/EmbedStreamTests.js @@ -170,7 +170,7 @@ module.exports = { // Verify that comment count is correct client.waitForElementVisible('.coral-plugin-comment-count-text', 2000) - .assert.containsText('.coral-plugin-comment-count-text', '1 Comment'); + .assert.containsText('.coral-plugin-comment-count-text', '2 Comments'); done(); }); }, diff --git a/test/e2e/tests/Visitor/SignUpTest.js b/test/e2e/tests/Visitor/SignUpTest.js index d37823ebf..d19ca1d8c 100644 --- a/test/e2e/tests/Visitor/SignUpTest.js +++ b/test/e2e/tests/Visitor/SignUpTest.js @@ -13,7 +13,7 @@ module.exports = { embedStreamPage .signUp({ email: `visitor_${Date.now()}@test.com`, - displayName: 'visitor', + displayName: `visitor${Date.now()}`, pass: 'testtest' }); },