Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
3855926a
Commit
3855926a
authored
Sep 15, 2016
by
jwzimmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tried to fix the errors for travis check, but wasn't sure how to handle some of them
parent
052819f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
test/integration/check_navbar_links.js
test/integration/check_navbar_links.js
+11
-9
No files found.
test/integration/check_navbar_links.js
View file @
3855926a
...
...
@@ -10,18 +10,20 @@ var tap=require('tap'),
/*
* 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
var
driver
=
new
seleniumWebdriver
.
Builder
().
withCapabilities
(
seleniumWebdriver
.
Capabilities
.
chrome
()).
build
();
//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
*/
//find the navbar
//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
//the create link depends on whether the user is signed in or not (tips window opens)
...
...
@@ -32,7 +34,7 @@ driver.get('https://scratch.ly')
//this xpath is fragile, can i look up by successive attributes instead?
tap
.
test
(
'
checkCreateLinkWhenSignedOut
'
,
function
(
t
)
{
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
.
end
();
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment