-
Notifications
You must be signed in to change notification settings - Fork 28
Deprecate safePageWait and remove existing references #112
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
Open
uuf6429
wants to merge
3
commits into
minkphp:master
Choose a base branch
from
uuf6429:chore/remove-faulty-safeWaits
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,11 +48,9 @@ public function testBasicForm(): void | |
|
|
||
| $page->pressButton('Save'); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { | ||
| $this->assertEquals('Anket for Konstantin', $webAssert->elementExists('css', 'h1')->getText()); | ||
| $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); | ||
| $this->assertEquals('Lastname: Kudryashov', $webAssert->elementExists('css', '#last')->getText()); | ||
| } | ||
| $this->assertEquals('Anket for Konstantin', $webAssert->elementExists('css', 'h1')->getText()); | ||
| $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); | ||
| $this->assertEquals('Lastname: Kudryashov', $webAssert->elementExists('css', '#last')->getText()); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -70,11 +68,7 @@ public function testFormSubmitWays(string $submitVia): void | |
|
|
||
| $page->pressButton($submitVia); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { | ||
| $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); | ||
| } else { | ||
| $this->fail('Form was never submitted'); | ||
| } | ||
| $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -98,9 +92,7 @@ public function testFormSubmit(): void | |
|
|
||
| $webAssert->elementExists('xpath', 'descendant-or-self::form[1]')->submit(); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { | ||
| $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); | ||
| } | ||
| $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); | ||
| } | ||
|
|
||
| public function testFormSubmitWithoutButton(): void | ||
|
|
@@ -113,9 +105,7 @@ public function testFormSubmitWithoutButton(): void | |
|
|
||
| $webAssert->elementExists('xpath', 'descendant-or-self::form[1]')->submit(); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { | ||
| $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); | ||
| } | ||
| $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); | ||
| } | ||
|
|
||
| public function testBasicGetForm(): void | ||
|
|
@@ -204,8 +194,8 @@ public function testAdvancedForm(): void | |
|
|
||
| $button->press(); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementsByTagName("title") === "Advanced form save"')) { | ||
| $out = <<<'OUT' | ||
| $this->assertStringContainsString( | ||
| <<<'OUT' | ||
| array( | ||
| agreement = `on`, | ||
| email = `[email protected]`, | ||
|
|
@@ -218,9 +208,9 @@ public function testAdvancedForm(): void | |
| ) | ||
| some_file.txt | ||
| 1 uploaded file | ||
| OUT; | ||
| $this->assertStringContainsString($out, $page->getContent()); | ||
| } | ||
| OUT, | ||
| $page->getContent() | ||
| ); | ||
| } | ||
|
|
||
| public function testQuoteInValue(): void | ||
|
|
@@ -245,22 +235,27 @@ public function testQuoteInValue(): void | |
|
|
||
| $button->press(); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { | ||
| $out = <<<'OUT' | ||
| $this->assertThat( | ||
| $page->getContent(), | ||
| $this->logicalOr( | ||
| $this->stringContains( | ||
| <<<'OUT' | ||
| first_name = `Foo "item"`, | ||
| last_name = `Bar`, | ||
| OUT; | ||
| OUT | ||
| ), | ||
| $this->stringContains( | ||
| // Escaping of double quotes are optional in HTML text nodes. Even though our backend escapes | ||
| // the quote in the HTML when returning it, browsers may apply only the minimal escaping in | ||
| // the content they expose to Selenium depending of how they build it (they might serialize | ||
| // their DOM again rathet than returning the raw HTTP response content). | ||
| $minEscapedOut = <<<'OUT' | ||
| // their DOM again rather than returning the raw HTTP response content). | ||
| <<<'OUT' | ||
| first_name = `Foo "item"`, | ||
| last_name = `Bar`, | ||
| OUT; | ||
|
|
||
| $this->assertThat($page->getContent(), $this->logicalOr($this->stringContains($out), $this->stringContains($minEscapedOut))); | ||
| } | ||
| OUT | ||
| ) | ||
| ) | ||
| ); | ||
| } | ||
|
|
||
| public function testMultiInput(): void | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,14 +24,14 @@ public function testHtml5FormInputAttribute(): void | |
|
|
||
| $page->pressButton('Submit in form'); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { | ||
| $out = <<<'OUT' | ||
| $this->assertStringContainsString( | ||
| <<<'OUT' | ||
| first_name = `John`, | ||
| last_name = `Doe`, | ||
| OUT; | ||
| $this->assertStringContainsString($out, $page->getContent()); | ||
| $this->assertStringNotContainsString('other_field', $page->getContent()); | ||
| } | ||
| OUT, | ||
| $page->getContent() | ||
| ); | ||
| $this->assertStringNotContainsString('other_field', $page->getContent()); | ||
| } | ||
|
|
||
| public function testHtml5FormRadioAttribute(): void | ||
|
|
@@ -72,14 +72,14 @@ public function testHtml5FormButtonAttribute(): void | |
|
|
||
| $page->pressButton('Submit outside form'); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { | ||
| $out = <<<'OUT' | ||
| $this->assertStringContainsString( | ||
| <<<'OUT' | ||
| first_name = `John`, | ||
| last_name = `Doe`, | ||
| submit_button = `test`, | ||
| OUT; | ||
| $this->assertStringContainsString($out, $page->getContent()); | ||
| } | ||
| OUT, | ||
| $page->getContent() | ||
| ); | ||
| } | ||
|
|
||
| public function testHtml5FormOutside(): void | ||
|
|
@@ -91,13 +91,13 @@ public function testHtml5FormOutside(): void | |
|
|
||
| $page->pressButton('Submit separate form'); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { | ||
| $out = <<<'OUT' | ||
| $this->assertStringContainsString( | ||
| <<<'OUT' | ||
| other_field = `hello`, | ||
| OUT; | ||
| $this->assertStringContainsString($out, $page->getContent()); | ||
| $this->assertStringNotContainsString('first_name', $page->getContent()); | ||
| } | ||
| OUT, | ||
| $page->getContent() | ||
| ); | ||
| $this->assertStringNotContainsString('first_name', $page->getContent()); | ||
| } | ||
|
|
||
| public function testHtml5Types(): void | ||
|
|
@@ -115,7 +115,8 @@ public function testHtml5Types(): void | |
|
|
||
| $page->pressButton('Submit'); | ||
|
|
||
| $out = <<<'OUT' | ||
| $this->assertStringContainsString( | ||
| <<<'OUT' | ||
| color = `#ff00aa`, | ||
| date = `1111-11-11`, | ||
| email = `[email protected]`, | ||
|
|
@@ -124,9 +125,9 @@ public function testHtml5Types(): void | |
| submit_button = `Submit`, | ||
| time = `14:12`, | ||
| url = `https://mink.behat.org/`, | ||
| OUT; | ||
|
|
||
| $this->assertStringContainsString($out, $page->getContent()); | ||
| OUT, | ||
| $page->getContent() | ||
| ); | ||
| } | ||
|
|
||
| public function testHtml5FormAction(): void | ||
|
|
@@ -137,10 +138,8 @@ public function testHtml5FormAction(): void | |
| $page->fillField('first_name', 'Jimmy'); | ||
| $page->pressButton('Submit to basic form'); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { | ||
| $this->assertStringContainsString('<title>Basic Form Saving</title>', $page->getContent()); | ||
| $this->assertStringContainsString('Firstname: Jimmy', $page->getContent()); | ||
| } | ||
| $this->assertStringContainsString('<title>Basic Form Saving</title>', $page->getContent()); | ||
| $this->assertStringContainsString('Firstname: Jimmy', $page->getContent()); | ||
| } | ||
|
|
||
| public function testHtml5FormMethod(): void | ||
|
|
@@ -152,12 +151,10 @@ public function testHtml5FormMethod(): void | |
| $page->fillField('last_name', 'Jones'); | ||
| $page->pressButton('Submit as GET'); | ||
|
|
||
| if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { | ||
| $this->assertEquals( | ||
| $this->pathTo('advanced_form_post.php') . '?first_name=Jimmy&last_name=Jones', | ||
| $this->getSession()->getCurrentUrl() | ||
| ); | ||
| } | ||
| $this->assertEquals( | ||
| $this->pathTo('advanced_form_post.php') . '?first_name=Jimmy&last_name=Jones', | ||
| $this->getSession()->getCurrentUrl() | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.