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
af0088df
Commit
af0088df
authored
5 years ago
by
Ben Wheeler
Browse files
Options
Downloads
Patches
Plain Diff
add findByXpath to wait for updated or new items to appear
parent
5ee641e7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/integration/blocks.test.js
+17
-2
17 additions, 2 deletions
test/integration/blocks.test.js
with
17 additions
and
2 deletions
test/integration/blocks.test.js
+
17
−
2
View file @
af0088df
...
...
@@ -9,6 +9,7 @@ const {
findByXpath
,
getDriver
,
getLogs
,
Key
,
loadUri
,
rightClickText
,
scope
...
...
@@ -185,6 +186,10 @@ describe('Working with the blocks', () => {
await
clickText
(
'
costume2
'
,
scope
.
costumesTab
);
const
el
=
await
findByXpath
(
"
//input[@value='costume2']
"
);
await
el
.
sendKeys
(
'
newname
'
);
await
el
.
sendKeys
(
Key
.
ENTER
);
// wait until the updated costume appears in costume item list panel
await
findByXpath
(
"
//div[contains(@class,'sprite-selector-item_is-selected_')]
"
+
"
//div[contains(text(), 'newname')]
"
);
// Make sure it is updated in the block menu
await
clickText
(
'
Code
'
);
...
...
@@ -193,7 +198,7 @@ describe('Working with the blocks', () => {
await
clickText
(
'
newname
'
,
scope
.
blocksTab
);
});
test
.
skip
(
'
Renaming costume with a special character should not break toolbox
'
,
async
()
=>
{
test
(
'
Renaming costume with a special character should not break toolbox
'
,
async
()
=>
{
await
loadUri
(
uri
);
// Rename the costume
...
...
@@ -201,6 +206,10 @@ describe('Working with the blocks', () => {
await
clickText
(
'
costume2
'
,
scope
.
costumesTab
);
const
el
=
await
findByXpath
(
"
//input[@value='costume2']
"
);
await
el
.
sendKeys
(
'
<NewCostume>
'
);
await
el
.
sendKeys
(
Key
.
ENTER
);
// wait until the updated costume appears in costume item list panel
await
findByXpath
(
"
//div[contains(@class,'sprite-selector-item_is-selected_')]
"
+
"
//div[contains(text(), '<NewCostume>')]
"
);
// Make sure it is updated in the block menu
await
clickText
(
'
Code
'
);
...
...
@@ -226,6 +235,9 @@ describe('Working with the blocks', () => {
.
perform
();
await
driver
.
sleep
(
500
);
// Wait for thermometer menu to come up
await
clickXpath
(
'
//button[@aria-label="Paint"]
'
);
// wait until the new costume appears in costume item list panel
await
findByXpath
(
"
//div[contains(@class,'sprite-selector-item_is-selected_')]
"
+
"
//div[contains(text(), 'costume3')]
"
);
await
clickText
(
'
costume3
'
,
scope
.
costumesTab
);
// Check that the menu has been updated
await
clickText
(
'
Code
'
);
...
...
@@ -233,11 +245,14 @@ describe('Working with the blocks', () => {
});
// Skipped because it was flakey on travis, but seems to run locally ok
test
.
skip
(
'
Adding a sound DOES update the default sound name in the toolbox
'
,
async
()
=>
{
test
(
'
Adding a sound DOES update the default sound name in the toolbox
'
,
async
()
=>
{
await
loadUri
(
uri
);
await
clickText
(
'
Sounds
'
);
await
clickXpath
(
'
//button[@aria-label="Choose a Sound"]
'
);
await
clickText
(
'
A Bass
'
,
scope
.
modal
);
// Should close the modal
// wait until the selected sound appears in sounds item list panel
await
findByXpath
(
"
//div[contains(@class,'sprite-selector-item_is-selected_')]
"
+
"
//div[contains(text(), 'A Bass')]
"
);
await
clickText
(
'
Code
'
);
await
clickText
(
'
Sound
'
,
scope
.
blocksTab
);
await
driver
.
sleep
(
500
);
// Wait for scroll to finish
...
...
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