From 3b885a4f38c962b16145e1b2351726a0b520a30a Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Thu, 21 Apr 2016 10:36:15 +0200 Subject: [PATCH] Remove phantomjs launcher leftover from rebase merge --- phantomjs/launch_app_and_login.js | 62 ------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 phantomjs/launch_app_and_login.js diff --git a/phantomjs/launch_app_and_login.js b/phantomjs/launch_app_and_login.js deleted file mode 100644 index e5418519..00000000 --- a/phantomjs/launch_app_and_login.js +++ /dev/null @@ -1,62 +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'; - -var page = require('webpage').create(); -page.open(localEnv, function(status) { - var attemptedToLogIn; - var loginCheckInterval; - - console.log('Status: ' + 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[type=email]'); - var password = inputForm.querySelector('input[type=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.'); - } - }, 1000); - } else { - console.log('Something happened while trying to log in, aborting...'); - phantom.exit(); - } - - } else { - console.log('Failed to load page, exiing...'); - phantom.exit(); - } -});