diff --git a/test/gemini/README.md b/test/gemini/README.md index bc029041..3521056e 100644 --- a/test/gemini/README.md +++ b/test/gemini/README.md @@ -190,9 +190,9 @@ current execution state of that breakpoint on the page you're on. --- -To simplify triaging simple issues and test if everything is working, I've added a short test script that can be run -with PhantomJS to check if it can access the web app and log in. You can edit the `lauch_app_and_login.js` file to -change the environment to run against. +To simplify triaging simple issues and test if everything is working, The repo had a short test script that can be run +with PhantomJS to check if it can access the web app and log in. Find `onion/test/phantomjs/launch_app_and_login.js` in +the repo's history, restore it, and then run: ```bash # In root /onion folder diff --git a/test/phantomjs/launch_app_and_login.js b/test/phantomjs/launch_app_and_login.js deleted file mode 100644 index afc76f9e..00000000 --- a/test/phantomjs/launch_app_and_login.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -var liveEnv = 'https://www.ascribe.io/app/login'; -// Note that if you are trying to access staging, you will need to use -// the --ignore-ssl-errors=true flag on phantomjs -var stagingEnv = 'https://www.ascribe.ninja/app/login'; -var localEnv = 'http://localhost.com:3000/login'; - -function launchAppAndLogin(env) { - console.log('Running test to launch ' + env + ' and log into the app'); - - var page = require('webpage').create(); - page.open(localEnv, function(status) { - var attemptedToLogIn; - var loginCheckInterval; - - console.log('Load ' + env + ': ' + status); - - if (status === 'success') { - console.log('Attempting to log in...'); - - attemptedToLogIn = page.evaluate(function () { - try { - var inputForm = document.querySelector('.ascribe-login-wrapper'); - var email = inputForm.querySelector('input[name=email]'); - var password = inputForm.querySelector('input[name=password]'); - var submitBtn = inputForm.querySelector('button[type=submit]'); - - email.value = 'dimi@mailinator.com'; - password.value = '0000000000'; - submitBtn.click(); - - return true; - } catch (ex) { - console.log('Error while trying to find login elements, not logging in.'); - return false; - } - }); - - if (attemptedToLogIn) { - loginCheckInterval = setInterval(function () { - var loggedIn = page.evaluate(function () { - // When they log in, they are taken to the collections page. - // When the piece list is loaded, the accordion list is either available or - // shows a placeholder, so let's check for these elements to determine - // when login is finished - return !!(document.querySelector('.ascribe-accordion-list:not(.ascribe-loading-position)') || - document.querySelector('.ascribe-accordion-list-placeholder')); - }); - - if (loggedIn) { - clearInterval(loginCheckInterval); - console.log('Successfully logged in.'); - console.log('Edit the onion/test/phantomjs/launch_app_and_login.js file to do further actions after logging in.'); - console.log('Stopping phantomJS...'); - phantom.exit(); - } - }, 1000); - } else { - console.log('Something happened while trying to log in, aborting...'); - phantom.exit(); - } - - } else { - console.log('Failed to load page, exiing...'); - phantom.exit(); - } - }); -} - -launchAppAndLogin(localEnv);