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
2813218d
Commit
2813218d
authored
Oct 23, 2017
by
jwzimmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added signing out from discuss (scratchr2)
parent
658a65c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
0 deletions
+117
-0
test/integration/smoke-testing/test_signing_in_and_out_discuss.js
...egration/smoke-testing/test_signing_in_and_out_discuss.js
+59
-0
test/integration/smoke-testing/test_signing_in_and_out_homepage.js
...gration/smoke-testing/test_signing_in_and_out_homepage.js
+58
-0
No files found.
test/integration/smoke-testing/test_signing_in_and_out_discuss.js
0 → 100644
View file @
2813218d
/*
* Tests from:
*
* https://github.com/LLK/scratchr2/wiki/Smoke-Testing-Test-Cases
*
*/
const
{
clickText
,
findByXpath
,
findText
,
clickXpath
,
clickButton
,
driver
}
=
require
(
'
../../helpers/selenium-helpers.js
'
);
var
username
=
process
.
env
.
SMOKE_USERNAME
;
var
password
=
process
.
env
.
SMOKE_PASSWORD
;
var
tap
=
require
(
'
tap
'
);
const
test
=
tap
.
test
;
var
rootUrl
=
process
.
env
.
ROOT_URL
||
'
https://scratch.ly
'
;
var
url
=
rootUrl
+
'
/discuss
'
;
tap
.
plan
(
2
);
tap
.
tearDown
(
function
()
{
driver
.
quit
();
});
tap
.
beforeEach
(
function
()
{
return
driver
.
get
(
url
);
});
test
(
'
Sign in to Scratch using scratchr2 navbar
'
,
t
=>
{
clickText
(
'
Sign in
'
)
.
then
(()
=>
findByXpath
(
'
//input[@id="login_dropdown_username"]
'
))
.
then
((
element
)
=>
element
.
sendKeys
(
username
))
.
then
(()
=>
findByXpath
(
'
//input[@name="password"]
'
))
.
then
((
element
)
=>
element
.
sendKeys
(
password
))
.
then
(()
=>
clickButton
(
'
Sign in
'
))
.
then
(()
=>
findByXpath
(
'
//li[contains(@class, "logged-in-user")
'
+
'
and contains(@class, "dropdown")]/span
'
))
.
then
((
element
)
=>
element
.
getText
(
'
span
'
))
.
then
((
text
)
=>
t
.
match
(
text
.
toLowerCase
(),
username
.
substring
(
0
,
10
).
toLowerCase
(),
'
first part of username should be displayed in navbar
'
))
.
then
(()
=>
t
.
end
());
});
test
(
'
Sign out of Scratch using scratchr2 navbar
'
,
t
=>
{
clickXpath
(
'
//span[contains(@class, "user-name")
'
+
'
and contains(@class, "dropdown-toggle")]/img[@class="user-icon"]
'
)
.
then
(()
=>
clickXpath
(
'
//input[@value="Sign out"]
'
))
.
then
(()
=>
findText
(
'
Sign in
'
))
.
then
((
element
)
=>
t
.
ok
(
element
,
'
Sign in reappeared on the page after signing out
'
))
.
then
(()
=>
t
.
end
());
});
test/integration/smoke-testing/test_signing_in_and_out_homepage.js
0 → 100644
View file @
2813218d
/*
* Tests from:
*
* https://github.com/LLK/scratchr2/wiki/Smoke-Testing-Test-Cases
*
*/
const
{
clickText
,
findText
,
findByXpath
,
clickXpath
,
driver
}
=
require
(
'
../../helpers/selenium-helpers.js
'
);
var
username
=
process
.
env
.
SMOKE_USERNAME
;
var
password
=
process
.
env
.
SMOKE_PASSWORD
;
var
tap
=
require
(
'
tap
'
);
const
test
=
tap
.
test
;
var
rootUrl
=
process
.
env
.
ROOT_URL
||
'
https://scratch.ly
'
;
tap
.
plan
(
2
);
tap
.
tearDown
(
function
()
{
driver
.
quit
();
});
tap
.
beforeEach
(
function
()
{
return
driver
.
get
(
rootUrl
);
});
test
(
'
Sign in to Scratch using scratch-www navbar
'
,
t
=>
{
clickText
(
'
Sign in
'
)
.
then
(()
=>
findByXpath
(
'
//input[@id="frc-username-1088"]
'
))
.
then
((
element
)
=>
element
.
sendKeys
(
username
))
.
then
(()
=>
findByXpath
(
'
//input[@id="frc-password-1088"]
'
))
.
then
((
element
)
=>
element
.
sendKeys
(
password
))
.
then
(()
=>
clickXpath
(
'
//button[contains(@class, "button") and
'
+
'
contains(@class, "submit-button") and contains(@class, "white")]
'
))
.
then
(()
=>
findByXpath
(
'
//span[@class="profile-name"]
'
))
.
then
((
element
)
=>
element
.
getText
())
.
then
((
text
)
=>
t
.
match
(
text
.
toLowerCase
(),
username
.
substring
(
0
,
10
).
toLowerCase
(),
'
first part of username should be displayed in navbar
'
))
.
then
(()
=>
t
.
end
());
});
test
(
'
Sign out of Scratch using scratch-www navbar
'
,
t
=>
{
clickXpath
(
'
//a[@class="user-info"]
'
)
.
then
(()
=>
clickText
(
'
Sign out
'
))
.
then
(()
=>
findText
(
'
Sign in
'
))
.
then
((
element
)
=>
t
.
ok
(
element
,
'
Sign in reappeared on the page after signing out
'
))
.
then
(()
=>
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