rld']);
}
@@ -1403,6 +1438,7 @@ public function testTextFieldByNameFirstNotCss()
$this->module->fillField('description', 'description');
$this->module->fillField('price', '19.99');
$this->module->click('Create');
+
$data = data::get('form');
$this->assertEquals('Special Widget', $data['title']);
}
@@ -1415,6 +1451,7 @@ public function testCheckingOptionsWithComplexNames()
$this->module->amOnPage('/form/bug1535');
$this->module->checkOption('#bmessage-topicslinks input[value="4"]');
$this->module->click('Submit');
+
$data = data::get('form');
$this->assertContains('4', $data['BMessage']['topicsLinks']);
}
@@ -1431,6 +1468,7 @@ public function testUnreachableField()
$this->module->fillField('input[name="users[]"]', 'davert');
$this->module->attachFile('input[name="files[]"]', 'app/avatar.jpg');
$this->module->click('Submit');
+
$data = data::get('form');
$this->assertContains('test3', $data['items'][1]);
$this->assertContains('test2', $data['captions']);
@@ -1441,6 +1479,7 @@ public function testSubmitAdjacentForms()
{
$this->module->amOnPage('/form/submit_adjacentforms');
$this->module->submitForm('#form-2', []);
+
$data = data::get('form');
$this->assertArrayHasKey('second-field', $data);
$this->assertArrayNotHasKey('first-field', $data);
@@ -1453,6 +1492,7 @@ public function testSubmitAdjacentFormsByButton()
$this->module->fillField('first-field', 'First');
$this->module->fillField('second-field', 'Second');
$this->module->click('#submit1');
+
$data = data::get('form');
$this->assertArrayHasKey('first-field', $data);
$this->assertArrayNotHasKey('second-field', $data);
@@ -1462,6 +1502,7 @@ public function testSubmitAdjacentFormsByButton()
$this->module->fillField('first-field', 'First');
$this->module->fillField('second-field', 'Second');
$this->module->click('#submit2');
+
$data = data::get('form');
$this->assertArrayNotHasKey('first-field', $data);
$this->assertArrayHasKey('second-field', $data);
@@ -1496,12 +1537,12 @@ public function testSelectAndCheckOptionSquareBracketNames()
$this->module->selectOption('//input[@name="input_radio_name"]', '1');
$this->module->selectOption('//input[@name="input_radio_name"]', '2');
- $this->module->checkOption('//input[@name="input_checkbox_name"]', '1');
- $this->module->checkOption('//input[@name="input_checkbox_name"]', '2');
+ $this->module->checkOption('//input[@name="input_checkbox_name"]');
+ $this->module->checkOption('//input[@name="input_checkbox_name"]');
- $this->module->checkOption('//input[@name="input[checkbox][name][]"]', '1');
- $this->module->checkOption('//input[@name="input[checkbox][name][]"]', '2');
- $this->module->checkOption('//input[@name="input[checkbox][name][]"]', '1');
+ $this->module->checkOption('//input[@name="input[checkbox][name][]"]');
+ $this->module->checkOption('//input[@name="input[checkbox][name][]"]');
+ $this->module->checkOption('//input[@name="input[checkbox][name][]"]');
$this->module->selectOption('//select[@name="select_name"]', '1');
@@ -1517,6 +1558,7 @@ public function testFillFieldWithAmpersand()
$this->module->amOnPage('/form/field');
$this->module->fillField('Name', 'this & that');
$this->module->click('Submit');
+
$form = data::get('form');
$this->assertEquals('this & that', $form['name']);
}
@@ -1573,7 +1615,7 @@ public function testClickMultiByteLink()
*/
public function testClickThrowsElementNotFoundExceptionWhenTextContainsNumber()
{
- $this->expectException('Codeception\Exception\ElementNotFound');
+ $this->expectException(ElementNotFound::class);
$this->expectExceptionMessage("'Link 2' is invalid CSS and XPath selector and Link or Button element with 'name=Link 2' was not found.");
$this->module->amOnPage('/info');
$this->module->click('Link 2');
@@ -1591,6 +1633,7 @@ public function testSelectOptionValueSelector()
$this->module->amOnPage('/form/select_selectors');
$this->module->selectOption('age', ['value' => '20']);
$this->module->click('Submit');
+
$data = data::get('form');
$this->assertEquals('20', $data['age']);
}
@@ -1695,7 +1738,7 @@ public function testAttachFileThrowsCorrectMessageWhenFileDoesNotExist()
{
$filename = 'does-not-exist.jpg';
$expectedMessage = 'File does not exist: ' . codecept_data_dir($filename);
- $this->expectException('InvalidArgumentException');
+ $this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage($expectedMessage);
$this->module->amOnPage('/form/file');
@@ -1705,8 +1748,9 @@ public function testAttachFileThrowsCorrectMessageWhenFileDoesNotExist()
public function testPasswordArgument()
{
$this->module->amOnPage('/form/password_argument');
- $this->module->fillField('password', new \Codeception\Step\Argument\PasswordArgument('thisissecret'));
+ $this->module->fillField('password', new PasswordArgument('thisissecret'));
$this->module->click('Submit');
+
$data = data::get('form');
$this->assertEquals('thisissecret', $data['password']);
}
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy