Skip to content

Commit

Permalink
Fix browser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hasanakg committed Nov 10, 2023
1 parent 9f4bd03 commit 825ba7b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion resources/js/Pages/Results.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</form>
</section>
</section>
<cdx-dialog class="confirmation-dialog"
<cdx-dialog id="results-confirmation-dialog"
:title="$i18n('confirmation-dialog-title')"
v-model:open="confirmationDialog"
:primary-action="{
Expand Down
10 changes: 5 additions & 5 deletions tests/Browser/Components/DecisionDropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(int $mismatchId)
*/
public function selector()
{
return "#mismatch-$this->mismatchId .wikit-Dropdown";
return "#mismatch-$this->mismatchId .cdx-select-vue";
}

/**
Expand All @@ -41,17 +41,17 @@ 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'
];
}

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);
})
Expand Down
4 changes: 2 additions & 2 deletions tests/Browser/ItemsFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});
}

Expand All @@ -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'));
});
}

Expand Down
3 changes: 2 additions & 1 deletion tests/Browser/Pages/HomePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
];
}
}
2 changes: 1 addition & 1 deletion tests/Browser/Pages/ResultsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 825ba7b

Please sign in to comment.