Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
a84e7fa7
Commit
a84e7fa7
authored
7 years ago
by
Paul Kaplan
Browse files
Options
Downloads
Patches
Plain Diff
Rework for import
parent
bd6e64d0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/helpers/selenium-helpers.js
+4
-10
4 additions, 10 deletions
test/helpers/selenium-helpers.js
test/integration/test.js
+8
-11
8 additions, 11 deletions
test/integration/test.js
with
12 additions
and
21 deletions
test/helpers/selenium-helpers.js
+
4
−
10
View file @
a84e7fa7
/* eslint-env jest */
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
30000
;
// eslint-disable-line no-undef
cons
t
webdriver
=
require
(
'
selenium-webdriver
'
)
;
impor
t
webdriver
from
'
selenium-webdriver
'
;
const
{
By
,
until
}
=
webdriver
;
...
...
@@ -9,10 +9,6 @@ const driver = new webdriver.Builder()
.
forBrowser
(
'
chrome
'
)
.
build
();
const
clickScriptsTab
=
()
=>
driver
.
findElement
(
By
.
id
(
'
react-tabs-0
'
)).
click
();
const
clickCostumeTab
=
()
=>
driver
.
findElement
(
By
.
id
(
'
react-tabs-2
'
)).
click
();
const
clickSoundsTab
=
()
=>
driver
.
findElement
(
By
.
id
(
'
react-tabs-4
'
)).
click
();
const
findByXpath
=
(
xpath
)
=>
{
return
driver
.
wait
(
until
.
elementLocated
(
By
.
xpath
(
xpath
),
5
*
1000
));
};
...
...
@@ -24,6 +20,7 @@ const clickXpath = (xpath) => {
const
clickText
=
(
text
)
=>
{
return
clickXpath
(
`//*[contains(text(), '
${
text
}
')]`
);
};
const
clickButton
=
(
text
)
=>
{
return
clickXpath
(
`//button[contains(text(), '
${
text
}
')]`
);
};
...
...
@@ -48,13 +45,10 @@ const getLogs = (whitelist) => {
};
export
{
getLogs
,
clickText
,
clickButton
,
clickXpath
,
driver
,
findByXpath
,
clickCostumeTab
,
clickScriptsTab
,
clickSoundsTab
,
driver
getLogs
};
This diff is collapsed.
Click to expand it.
test/integration/test.js
+
8
−
11
View file @
a84e7fa7
/* eslint-env jest */
const
{
getLogs
,
import
path
from
'
path
'
;
import
{
clickText
,
clickButton
,
clickXpath
,
driver
,
findByXpath
,
clickCostumeTab
,
clickScriptsTab
,
clickSoundsTab
,
driver
}
=
require
(
'
../helpers/selenium-helpers
'
);
getLogs
}
from
'
../helpers/selenium-helpers
'
;
const
path
=
require
(
'
path
'
);
const
uri
=
path
.
resolve
(
__dirname
,
'
../../build/index.html
'
);
const
errorWhitelist
=
[
...
...
@@ -25,7 +22,7 @@ describe('costumes, sounds and variables', () => {
test
(
'
Adding a costume
'
,
()
=>
{
return
driver
.
get
(
'
file://
'
+
uri
)
.
then
(()
=>
clickCostume
Tab
(
))
.
then
(()
=>
click
Text
(
'
Costume
s
'
))
.
then
(()
=>
clickText
(
'
Add Costume
'
))
.
then
(()
=>
findByXpath
(
"
//input[@placeholder='what are you looking for?']
"
))
.
then
((
el
)
=>
el
.
sendKeys
(
'
abb
'
))
...
...
@@ -38,7 +35,7 @@ describe('costumes, sounds and variables', () => {
test
(
'
Adding a sound
'
,
()
=>
{
return
driver
.
get
(
'
file://
'
+
uri
)
.
then
(()
=>
clickSounds
Tab
(
))
.
then
(()
=>
click
Text
(
'
Sounds
'
))
.
then
(()
=>
clickText
(
'
Add Sound
'
))
.
then
(()
=>
findByXpath
(
"
//input[@placeholder='what are you looking for?']
"
))
.
then
((
el
)
=>
el
.
sendKeys
(
'
chom
'
))
...
...
@@ -73,7 +70,7 @@ describe('costumes, sounds and variables', () => {
test
(
'
Creating a variable
'
,
()
=>
{
return
driver
.
get
(
'
file://
'
+
uri
)
.
then
(()
=>
click
ScriptsTab
(
))
.
then
(()
=>
click
Text
(
'
Blocks
'
))
.
then
(()
=>
clickText
(
'
Data
'
))
.
then
(()
=>
clickText
(
'
Create variable...
'
))
.
then
(()
=>
findByXpath
(
"
//input[@placeholder='']
"
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment