From 825ba7b251ee7c813e4dbeed5c247423b2885829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20Akg=C3=BCn?= Date: Fri, 10 Nov 2023 13:58:05 +0100 Subject: [PATCH] Fix browser tests --- resources/js/Pages/Results.vue | 2 +- tests/Browser/Components/DecisionDropdown.php | 10 +++++----- tests/Browser/ItemsFormTest.php | 4 ++-- tests/Browser/Pages/HomePage.php | 3 ++- tests/Browser/Pages/ResultsPage.php | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/js/Pages/Results.vue b/resources/js/Pages/Results.vue index 6bb9b9c77..e9a6d7684 100644 --- a/resources/js/Pages/Results.vue +++ b/resources/js/Pages/Results.vue @@ -109,7 +109,7 @@ - mismatchId .wikit-Dropdown"; + return "#mismatch-$this->mismatchId .cdx-select-vue"; } /** @@ -41,9 +41,9 @@ public function assert(Browser $browser) public function elements() { return [ - '@select-menu' => '.wikit-Dropdown__select', - '@selected' => '.wikit-Dropdown__selectedOption', - '@menu-items' => '.wikit-Dropdown__menu' + '@select-menu' => '.cdx-select-vue__handle', + '@selected' => '.cdx-select-vue__handle', + '@menu-items' => '.cdx-menu__listbox' ]; } @@ -51,7 +51,7 @@ public function selectPosition(Browser $browser, int $position, string $option) { $browser->click('@select-menu') ->within('@menu-items', function ($menu) use ($position, $option) { - $positionSelector = ".wikit-OptionsMenu__item:nth-child($position)"; + $positionSelector = ".cdx-menu-item:nth-child($position)"; $menu->assertSeeIn($positionSelector, $option) ->click($positionSelector); }) diff --git a/tests/Browser/ItemsFormTest.php b/tests/Browser/ItemsFormTest.php index 39d4ce1b9..9fbb6aba9 100644 --- a/tests/Browser/ItemsFormTest.php +++ b/tests/Browser/ItemsFormTest.php @@ -48,7 +48,7 @@ public function test_empty_item_list_yields_warning() ->press('.submit-ids') ->assertSee('Please provide the Item identifiers that should be checked.'); - $this->assertStringContainsString('--warning', $browser->attribute('@items-input', 'class')); + $this->assertStringContainsString('--warning', $browser->attribute('@items-input-validation-message', 'class')); }); } @@ -72,7 +72,7 @@ public function test_invalid_item_list_yields_error() ->press('.submit-ids') ->assertSee('One or more Item identifiers couldn\'t be processed.'); - $this->assertStringContainsString('--error', $browser->attribute('@items-input', 'class')); + $this->assertStringContainsString('--error', $browser->attribute('@items-input-validation-message', 'class')); }); } diff --git a/tests/Browser/Pages/HomePage.php b/tests/Browser/Pages/HomePage.php index 98827ae5a..9cb9c141b 100644 --- a/tests/Browser/Pages/HomePage.php +++ b/tests/Browser/Pages/HomePage.php @@ -40,7 +40,8 @@ public function elements() { return [ '@form' => '#items-form', - '@items-input' => '@form textarea' + '@items-input' => '@form textarea', + '@items-input-validation-message' => '@form .wikit-TextArea .wikit-ValidationMessage' ]; } } diff --git a/tests/Browser/Pages/ResultsPage.php b/tests/Browser/Pages/ResultsPage.php index 4c845df30..8b6c7d3d5 100644 --- a/tests/Browser/Pages/ResultsPage.php +++ b/tests/Browser/Pages/ResultsPage.php @@ -47,7 +47,7 @@ public function elements() { return [ '@back-button' => '.back-button', - '@confirmation-dialog' => '.confirmation-dialog', + '@confirmation-dialog' => '#results-confirmation-dialog', '@disable-confirmation' => '.disable-confirmation', '@error-section' => '#error-section', '@disable-confirmation-label' => '.disable-confirmation>.wikit-checkbox__label'