Skip to content

Commit

Permalink
Fix the rest
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshino committed Dec 22, 2023
1 parent 704f11e commit 16f8d28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions Bugzilla/Test/Selenium.pm
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ sub get_text {
$locator = $self->_fix_locator($locator);
my $element = $self->find_element($locator);
if ($element) {
return trim($element->get_property('textContent'));
return trim($element->get_text() || $element->get_property('textContent'));
}
return '';
}
Expand All @@ -206,7 +206,8 @@ sub selected_label_is {
$locator . '/*[self::option|self::bz-option]');
};
foreach my $option (@options) {
my $text = trim($option->get_property('textContent'));
my $text
= trim($element->get_text() || $option->get_property('textContent'));
if ($text eq $label && $option->get_property('selected')) {
ok(1, "Selected label is: $label");
return;
Expand All @@ -228,7 +229,8 @@ sub get_selected_labels {
my @selected;
foreach my $element (@elements) {
next if !$element->is_selected();
push @selected, trim($element->get_property('textContent'));
push @selected,
trim($element->get_text() || $element->get_property('textContent'));
}
return @selected;
}
Expand All @@ -247,7 +249,8 @@ sub get_select_options {
if (@elements) {
my @options;
foreach my $element (@elements) {
push @options, trim($element->get_property('textContent'));
push @options,
trim($element->get_text() || $element->get_property('textContent'));
}
return @options;
}
Expand Down
8 changes: 4 additions & 4 deletions qa/t/2_test_flags.t
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ $sel->title_is("Create New Attachment for Bug #$bug1_id");
$sel->attach_file('//input[@name="data"]', $config->{attachment_file});
$sel->type_ok('//input[@name="description"]', "patch, v3");
$sel->click_ok('//input[@name="contenttypemethod" and @value="list"]');
$sel->select_ok('//bz-select[@name="contenttypeselection"]',
$sel->select_ok('//select[@name="contenttypeselection"]',
"label=plain text (text/plain)");
$sel->select_ok("flag_type-$aflagtype1_id", "label=+");
$sel->type_ok("comment", "one +, the other one blank");
Expand Down Expand Up @@ -485,7 +485,7 @@ $sel->click_ok(
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_like(qr/^Attachment $attachment2_id Details for Bug $bug1_id/);
$sel->is_element_present_ok(
'//bz-select[@title="attachmentflag2"][@disabled]',
'//select[@title="attachmentflag2"][@disabled]',
"Attachment flags are not editable by a powerless user"
);

Expand All @@ -504,7 +504,7 @@ $sel->type_ok('//input[@name="description"]', "patch, v4");
# canconfirm/editbugs privs are required to edit this flag.

$sel->is_element_present_ok(
qq{//bz-select[\@id="flag_type-$aflagtype1_id"][\@disabled]},
qq{//select[\@id="flag_type-$aflagtype1_id"][\@disabled]},
"Flag type non editable by powerless user");

# No privs are required to edit this flag.
Expand All @@ -529,7 +529,7 @@ $sel->click_ok(
"//a[contains(\@href,'/attachment.cgi?id=${attachment3_id}&action=edit')]");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_like(qr/^Attachment $attachment3_id Details for Bug $bug1_id/);
$sel->select_ok('//bz-select[@title="attachmentflag1"]', "label=+");
$sel->select_ok('//select[@title="attachmentflag1"]', "label=+");
$sel->click_ok("update");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->is_text_present_ok(
Expand Down

0 comments on commit 16f8d28

Please sign in to comment.