@@ -48,7 +48,7 @@ public function testBasicForm(): void
4848
4949 $ page ->pressButton ('Save ' );
5050
51- if ($ this ->safePageWait (5000 , 'document.getElementById(" first") !== null ' )) {
51+ if ($ this ->safePageWait (5000 , 'document.querySelector("# first") !== null ' )) {
5252 $ this ->assertEquals ('Anket for Konstantin ' , $ webAssert ->elementExists ('css ' , 'h1 ' )->getText ());
5353 $ this ->assertEquals ('Firstname: Konstantin ' , $ webAssert ->elementExists ('css ' , '#first ' )->getText ());
5454 $ this ->assertEquals ('Lastname: Kudryashov ' , $ webAssert ->elementExists ('css ' , '#last ' )->getText ());
@@ -70,7 +70,7 @@ public function testFormSubmitWays(string $submitVia): void
7070
7171 $ page ->pressButton ($ submitVia );
7272
73- if ($ this ->safePageWait (5000 , 'document.getElementById(" first") !== null ' )) {
73+ if ($ this ->safePageWait (5000 , 'document.querySelector("# first") !== null ' )) {
7474 $ this ->assertEquals ('Firstname: Konstantin ' , $ webAssert ->elementExists ('css ' , '#first ' )->getText ());
7575 } else {
7676 $ this ->fail ('Form was never submitted ' );
@@ -98,7 +98,7 @@ public function testFormSubmit(): void
9898
9999 $ webAssert ->elementExists ('xpath ' , 'descendant-or-self::form[1] ' )->submit ();
100100
101- if ($ this ->safePageWait (5000 , 'document.getElementById(" first") !== null ' )) {
101+ if ($ this ->safePageWait (5000 , 'document.querySelector("# first") !== null ' )) {
102102 $ this ->assertEquals ('Firstname: Konstantin ' , $ webAssert ->elementExists ('css ' , '#first ' )->getText ());
103103 }
104104 }
@@ -113,7 +113,7 @@ public function testFormSubmitWithoutButton(): void
113113
114114 $ webAssert ->elementExists ('xpath ' , 'descendant-or-self::form[1] ' )->submit ();
115115
116- if ($ this ->safePageWait (5000 , 'document.getElementById(" first") !== null ' )) {
116+ if ($ this ->safePageWait (5000 , 'document.querySelector("# first") !== null ' )) {
117117 $ this ->assertEquals ('Firstname: Konstantin ' , $ webAssert ->elementExists ('css ' , '#first ' )->getText ());
118118 }
119119 }
@@ -204,7 +204,7 @@ public function testAdvancedForm(): void
204204
205205 $ button ->press ();
206206
207- if ($ this ->safePageWait (5000 , 'document.getElementsByTagName ("title") === "Advanced form save" ' )) {
207+ if ($ this ->safePageWait (5000 , 'document.querySelector ("title")?.textContent === "Advanced form save" ' )) {
208208 $ out = <<<'OUT'
209209array(
210210 agreement = `on`,
@@ -245,7 +245,7 @@ public function testQuoteInValue(): void
245245
246246 $ button ->press ();
247247
248- if ($ this ->safePageWait (5000 , 'document.getElementsByTagName ("title") !== null ' )) {
248+ if ($ this ->safePageWait (5000 , 'document.querySelector ("title") !== null ' )) {
249249 $ out = <<<'OUT'
250250 first_name = `Foo "item"`,
251251 last_name = `Bar`,
0 commit comments