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
e485cf29
Commit
e485cf29
authored
Jun 25, 2021
by
BryceLTaylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add studios page integration tests
parent
bf91904a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
test/integration/studios-page.test.js
test/integration/studios-page.test.js
+57
-0
No files found.
test/integration/studios-page.test.js
0 → 100644
View file @
e485cf29
import
SeleniumHelper
from
'
./selenium-helpers.js
'
;
const
{
findByXpath
,
clickXpath
,
buildDriver
}
=
new
SeleniumHelper
();
let
remote
=
process
.
env
.
SMOKE_REMOTE
||
false
;
let
rootUrl
=
process
.
env
.
ROOT_URL
||
'
https://scratch.ly
'
;
let
studioId
=
process
.
env
.
TEST_STUDIO_ID
||
10004360
;
let
studioUrl
=
rootUrl
+
'
/studios/
'
+
studioId
;
if
(
remote
){
jest
.
setTimeout
(
60000
);
}
else
{
jest
.
setTimeout
(
20000
);
}
let
driver
;
describe
(
'
studio page while signed out
'
,
()
=>
{
beforeAll
(
async
()
=>
{
// expect(projectUrl).toBe(defined);
driver
=
await
buildDriver
(
'
www-integration studio-page signed out
'
);
await
driver
.
get
(
rootUrl
);
});
beforeEach
(
async
()
=>
{
await
driver
.
get
(
studioUrl
);
let
studioNav
=
await
findByXpath
(
'
//div[@class="studio-tabs"]
'
);
await
studioNav
.
isDisplayed
();
});
afterAll
(
async
()
=>
await
driver
.
quit
());
test
(
'
land on projects tab
'
,
async
()
=>
{
await
driver
.
get
(
studioUrl
);
let
projectGrid
=
await
findByXpath
(
'
//div[@class="studio-projects-grid"]
'
);
let
projectGridDisplayed
=
await
projectGrid
.
isDisplayed
();
await
expect
(
projectGridDisplayed
).
toBe
(
true
);
});
test
(
'
studio title
'
,
async
()
=>
{
let
studioTitle
=
await
findByXpath
(
'
//div[@class="studio-title"]
'
);
let
titleText
=
await
studioTitle
.
getText
();
await
expect
(
titleText
).
toEqual
(
'
studio for automated testing
'
);
});
test
(
'
studio description
'
,
async
()
=>
{
let
xpath
=
'
//div[contains(@class, "studio-description")]
'
;
let
studioDescription
=
await
findByXpath
(
xpath
);
let
descriptionText
=
await
studioDescription
.
getText
();
await
expect
(
descriptionText
).
toEqual
(
'
a description
'
);
});
});
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