Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests - do not rely on hardcoded/expected names #1245

Merged
merged 31 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b0ed358
init
ibelar Jun 5, 2020
ff3bd91
Apply fixes from StyleCI
ibelar Jun 5, 2020
3a9e2f0
wip
ibelar Jun 5, 2020
b2a5c41
Merge branch 'fix/unit-test-url' of https://github.com/atk4/ui into f…
ibelar Jun 5, 2020
aad6639
clean up unit test - add behat test
ibelar Jun 5, 2020
aafa316
final test
ibelar Jun 5, 2020
a457659
added basic action executor test in behat
ibelar Jun 5, 2020
71e7b4f
remove template from console output
ibelar Jun 5, 2020
f344249
Fix missing DIContainerTrait when StaticAddToTrait is used
mvorisek Jun 7, 2020
a83dc81
Fix missing DIContainerTrait when StaticAddToTrait is used
mvorisek Jun 7, 2020
78e1d09
Merge branch 'develop' into fix/unit-test-url
mvorisek Jun 7, 2020
6a6b03e
Merge branch 'fix_for_new_factory' into fix/unit-test-url
mvorisek Jun 7, 2020
5e4b2af
extra changes for merge
mvorisek Jun 7, 2020
035e349
Merge branch 'fix/unit-test-url' of https://github.com/atk4/ui into f…
ibelar Jun 7, 2020
e04b328
fix hardcode column name
ibelar Jun 7, 2020
0a72253
Apply fixes from StyleCI
ibelar Jun 7, 2020
a2d2a61
cs fixer
ibelar Jun 7, 2020
37a3b67
move utility function to trait
ibelar Jun 8, 2020
8a8d6a4
cs fixer
ibelar Jun 8, 2020
27a3f75
adding behat test for grid search
ibelar Jun 8, 2020
34daf33
refine search to kingdom only
ibelar Jun 8, 2020
5fc3b5c
wait for toast to hide
ibelar Jun 8, 2020
036291f
add crud testing in behat
ibelar Jun 8, 2020
cd275e2
replace jsNotify coverage
ibelar Jun 8, 2020
18bebc2
Merge branch 'develop' into fix/unit-test-url
ibelar Jun 9, 2020
959ba1b
Fix CS fixer config for "Callable" class
mvorisek Jun 10, 2020
30ca774
Refactor "I Wait x" to "I sleep x ms"
mvorisek Jun 10, 2020
2225c32
add FeatureContext::getSession() return type
mvorisek Jun 10, 2020
4a99f03
fix CS
mvorisek Jun 10, 2020
8c03449
add NS to FeatureContext
mvorisek Jun 10, 2020
3899e7a
fix bootstrap autoload/path
mvorisek Jun 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public function getSession($name = null)
}

/**
* Wait for a certain time in ms.
* Sleep for a certain time in ms.
*
* @Then I wait :arg1
* @Then I sleep :arg1 ms
*
* @param $arg1
*/
public function iWait($arg1)
public function iSleep($arg1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ibelar better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, in Behat feature step, it should represent a user action interacting with the browser. A user would rather 'wait' then 'sleep' before doing another action.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept all other (non-dummy) waits. But as dummy wait() (without test function) is a sleep (correct me if I am wrong), then sleep is much more self explaining.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may have to wait until dom element finishes transitioning, but you only know visually, but as a user, you are still waiting not falling asleep. ;)

Copy link
Member

@mvorisek mvorisek Jun 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;) then, now it is much clearer if a user sleep for a fixed TIME or wait (ie. with fixed TIMEOUT, but TIME can be shorter) for something.

I retested this PR and all fixed names are solved. Great work! Can we merge or do you have more ideas to add?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if you sleep in front of your computer, you might have a very boring app in front of you. :-) Go ahead, we can merge.

{
$this->getSession()->wait($arg1);
}
Expand Down
4 changes: 2 additions & 2 deletions features/crud.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Crud
Scenario: add
Then I press menu button "Add" using class "atk-grid-menu"
And wait for callback
And I wait "500"
And I sleep "500" ms
Then I fill in "name" with "Test"
Then I fill in "iso" with "TT"
Then I fill in "iso3" with "TTT"
Expand Down Expand Up @@ -38,7 +38,7 @@ Feature: Crud
Scenario: delete
Then I press button "Delete"
# Js Modal transition
And I wait "200"
And I sleep "250" ms
Then I press button "Ok"
And wait for callback
Then I should not see "United Kingdom"
2 changes: 1 addition & 1 deletion features/js.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: JS
And I don't see button "Hide button C"

# wait for DOM to complete button hiding
And I wait 500
And I sleep "500" ms

When I press button "Callback Test"
And wait for callback
Expand Down