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] Behat window size issue #1538

Closed
wants to merge 13 commits into from
Closed

[fix] Behat window size issue #1538

wants to merge 13 commits into from

Conversation

ibelar
Copy link
Contributor

@ibelar ibelar commented Nov 16, 2020

rebased once #1524 is merged

related with minkphp/MinkSelenium2Driver#327 , finish once merged & released

original discussion:

Fix issue with selenium/standalone-chrome image when test are run using arguments: --headless and --window-size together and window-size value is set using low value.
Most of the time, an element is not found or the element text value returns null, although the element contains the text.
see #1469

Note: --window-size option value must make sense since error like 'element click intercept' or 'element not interactable' will occur on certains tests.

@ibelar ibelar added the RTM label Nov 17, 2020
@ibelar ibelar requested a review from mvorisek November 17, 2020 03:41
behat.yml.dist Show resolved Hide resolved
tests-behat/bootstrap/Context.php Outdated Show resolved Hide resolved
@@ -275,8 +274,7 @@ public function iPressModalButton($arg)
*/
public function modalIsOpenWithText($arg1)
{
// get modal
$modal = $this->getSession()->getPage()->find('css', '.modal.transition.visible.active.front');
$modal = $this->waitForNodeElement('.modal.transition.visible.active.front');
Copy link
Member

Choose a reason for hiding this comment

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

for what - with jqueryWait, we wait for AJAX + some enough time in which all animations should finish.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because when content has finished loading inside the modal, the modal will resize according to new content.
If you try to get the modal window while it is reloading then the test fails because the modal return null.
You can look at the commit history to see.

Copy link
Member

Choose a reason for hiding this comment

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

I agree.

Now how to handle it - jquery wait should do that FOR EVERYTHING :)

do you interact with Modal as the "1st operation in Behat step"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not see anything that will let us know that the modal window is resizing and has finish resizing... Do you?
That is why I put a loop there. The other solution will be to intentionally wait for a few ms but I think the loop is better.

Copy link
Member

Choose a reason for hiding this comment

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

jquery wait waits some extra time for exactly these situations :)

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 I guess it does not wait long enough... I can try to increase time there but it will increase for every step, no?

Copy link
Member

Choose a reason for hiding this comment

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

do you interact with Modal as the "1st operation in Behat step"

if yes, then there is probably some other issue, as the additional delay is already quite long. And I tested it very extensively - there is probably other issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is an issue and this is how to fix it...

tests-behat/bootstrap/Context.php Outdated Show resolved Hide resolved
@mvorisek mvorisek removed the RTM label Nov 17, 2020
@ibelar ibelar added the RTM label Nov 17, 2020
@mvorisek mvorisek removed the RTM label Nov 17, 2020
@ibelar ibelar added the RTM label Nov 17, 2020
@mvorisek mvorisek removed the RTM label Nov 18, 2020
@ibelar ibelar added the RTM label Nov 18, 2020
@mvorisek mvorisek removed the RTM label Nov 18, 2020
@ibelar ibelar added the RTM label Nov 18, 2020
ibelar added a commit that referenced this pull request Nov 18, 2020
- fix until #1538 is resolved
ibelar added a commit that referenced this pull request Nov 18, 2020
until #1538 is resolve
DarkSide666 pushed a commit that referenced this pull request Nov 19, 2020
* refactor - Calendar input

Use flatPickr js.

* add localization

* allow time format changes and late options changed

* refactor init

* switch to flatpickr vue component

- multiine now use flatpickr
- queybuilder now use flatpickr

* refactor UI persistence

* fix getApp

* move Date props to format array

* fix

* move type class into array container

* refactor type

* update comment / cs fixer

* fixes

* add sample

* cs fixe

* improve example

* more sample

* fix label

* cs fix

* add behat test

* cs fix

* fixes

* update demo

* fixes

* fix getTheirModel to createTheirModel

* add flatpickr after merging develop

* update cdn cloudflare

* revert to previous ui_persistence

* remove old comments

* fix demo date input

* refactor query builder props

* cs fix

* use Calendar translate format

* base props on component instead of type

* remove static function

* revert options

* allow flatpickr option

* change function name and add comments

* cs fix

* Increase memory theshold for burn testing

* enhancement

- query builder date, datetime or time always output same format but still display according to ui persistence

* cs fix

* support for condition value

* use flatpickr altFormat

* incl build

* set html for behat test

* behat test for scopebuilder

* behat fix

* fix typo

* more typo

* add boolean rule

* behat check for word match

* rename demo to Scope Builder

* clean up

* remove comments

* update comments

* improve function var

* add check for input value in scopebuilder test

* revert preg_replace

* dump word

* dump exprected with no dump

* test

* test no input

* add container not found exeption

* increase headless window size

* update preg_replace pattern

* improve input error message

* revert to operator symbol

* refactor mulitline flatpickr option

* fixes

* remve pregreplace for word comparaison

* no ui exception in Behat

* workaround for window-size

* Update behat.yml.dist

Co-authored-by: Michael Voříšek <[email protected]>

* update js release

* new arrow function usage

* remove workaround

* fix behat

- fix until #1538 is resolved

* add temporary fix

until #1538 is resolve

* cs fix

* revert headless with bigger window size

Co-authored-by: Michael Voříšek <[email protected]>
@ibelar ibelar removed the RTM label Nov 19, 2020
@ibelar ibelar closed this Jan 5, 2021
@mvorisek
Copy link
Member

mvorisek commented Jan 12, 2021

@mvorisek
Copy link
Member

mvorisek commented Oct 4, 2021

closing because minkphp/MinkSelenium2Driver#327

might be interesing to replace the limited Mink impl. from our Context class

@mvorisek mvorisek closed this Oct 4, 2021
@mvorisek mvorisek deleted the fix/behat-chrome-option branch October 4, 2021 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants