Skip to content

Added the 'waitForPageLoad' action after every 'amOnPage' action #79

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

Merged
merged 5 commits into from
Apr 30, 2018
Merged

Added the 'waitForPageLoad' action after every 'amOnPage' action #79

merged 5 commits into from
Apr 30, 2018

Conversation

rocketweb
Copy link

@rocketweb rocketweb commented Apr 2, 2018

Description

Many times when various tests are running, there will be times when using the 'amOnPage' action, which will throw various errors due to the fact that some of the javascript elements, that the test is supposed to interact with, haven't loaded it. It might make sense to just automatically add the 'waitForPageLoad' action after the 'amOnPage' action.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/verification tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

@coveralls
Copy link

coveralls commented Apr 2, 2018

Coverage Status

Coverage decreased (-0.02%) to 50.327% when pulling b3cff79 on rocketweb:waitforpageload-after-amonpage into fb1e4b7 on magento:develop.

@okolesnyk okolesnyk added this to the 2.2.1 milestone Apr 18, 2018
Copy link
Contributor

@KevinBKozan KevinBKozan left a comment

Choose a reason for hiding this comment

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

Two comments, the idea is solid but it just needs to be moved and trimmed a bit!

* @throws \Exception
* @return void
*/
public function amOnPage($page)
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume that the goal here was to override the WebDriver's definition of amOnPage correct? If so, this function belongs in MagentoWebDriver.php, where we provide custom functions and redefinitions of some of the base Codeception commands.

{
$url = Uri::appendPath($this->config['url'], $page);
$this->debugSection('GET', $url);
$this->webDriver->get($url);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of defining these three lines, you should just call parent::amOnPage($page) to prevent duplicate code (since we're not changing amOnPage behaviour, just adding to it).

@okolesnyk okolesnyk added Partner: Rocket Web Pull Request is created by partner Rocket Web partners-contribution Pull Request is created by Magento Partner labels Apr 23, 2018
@KevinBKozan
Copy link
Contributor

Changes look great, thank you very much for your contribution!

@KevinBKozan KevinBKozan merged commit 4e1affe into magento:develop Apr 30, 2018
magento-devops-reposync-svc pushed a commit that referenced this pull request Jul 29, 2021
…2-functional-testing-framework-850

[Imported] 33309: Eliminated AspectMock usage from TestGeneratorTest.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accept Partner: Rocket Web Pull Request is created by partner Rocket Web partners-contribution Pull Request is created by Magento Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants