Commit 3855926a authored by jwzimmer's avatar jwzimmer

Tried to fix the errors for travis check, but wasn't sure how to handle some of them

parent 052819f8
...@@ -4,24 +4,26 @@ ...@@ -4,24 +4,26 @@
* Test cases: https://github.com/LLK/scratch-www/wiki/Most-Important-Workflows#Create_should_take_you_to_the_editor * Test cases: https://github.com/LLK/scratch-www/wiki/Most-Important-Workflows#Create_should_take_you_to_the_editor
*/ */
var tap=require('tap'), var tap=require('tap'),
seleniumWebdriver = require('selenium-webdriver'); seleniumWebdriver = require('selenium-webdriver');
/* /*
* Remove question comments after resolving them * Remove question comments after resolving them
*/ */
//how to generalize for other browsers... how will this work in saucelabs? Do I need to iterate through the drivers for each browser here? //how to generalize for other browsers... how will this work in saucelabs? Do I need to iterate
//through the drivers for each browser here?
//chrome driver //chrome driver
var driver = new seleniumWebdriver.Builder().withCapabilities(seleniumWebdriver.Capabilities.chrome()).build(); var driver = new seleniumWebdriver.Builder().withCapabilities(seleniumWebdriver.Capabilities.chrome()).build();
//open scratch.ly in a new instance of the browser //open scratch.ly in a new instance of the browser
driver.get('https://scratch.ly') driver.get('https://scratch.ly');
/* /*
* Remove question comments after resolving them * Remove question comments after resolving them
*/ */
//find the navbar //find the navbar
//var navbarElement = driver.findElement(seleniumWebdriver.By.id("navigation")) //var navbarElement = driver.findElement(seleniumWebdriver.By.id("navigation"))
//var createLinkSignedOut = navbarElement.findElement(seleniumWebdriver.By.xpath('//li[@class="link create"]/a')) <-- this doesn't work to force findElement to look in the scope of navbarElement //var createLinkSignedOut = navbarElement.findElement(seleniumWebdriver.By.xpath('//li[@class="link create"]/a'))
//^^this doesn't work to force findElement to look in the scope of navbarElement
//find the create link within the navbar //find the create link within the navbar
//the create link depends on whether the user is signed in or not (tips window opens) //the create link depends on whether the user is signed in or not (tips window opens)
...@@ -31,11 +33,11 @@ driver.get('https://scratch.ly') ...@@ -31,11 +33,11 @@ driver.get('https://scratch.ly')
*/ */
//this xpath is fragile, can i look up by successive attributes instead? //this xpath is fragile, can i look up by successive attributes instead?
tap.test('checkCreateLinkWhenSignedOut', function (t) { tap.test('checkCreateLinkWhenSignedOut', function (t) {
var createLinkSignedOut = driver.findElement(seleniumWebdriver.By.xpath('//div[@id="navigation"]/div[@class="inner"]/ul/li[@class="link create"]/a')); var createLinkSignedOut = driver.findElement(seleniumWebdriver.By.xpath('//div[@id="navigation"]/div[@class="inner"]/ul/li[@class="link create"]/a'));
createLinkSignedOut.getAttribute("href").then(function(href){ createLinkSignedOut.getAttribute('href').then( function (href) {
t.equal('https://scratch.ly/projects/editor/?tip_bar=home', href); t.equal('https://scratch.ly/projects/editor/?tip_bar=home', href);
t.end(); t.end();
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment