my ($self, $text) = @_;
TRACE("is_text_present: $text");
return 0 unless $text;
- my $body = $self->driver->get_body();
+ # Execute script directly because `get_body()` doesn't contain hidden text
+ my $body = $self->driver->execute_script(
+ "return document.body.textContent.replace(/\\s+/g, ' ')");
if ($text =~ /^regexp:(.*)$/) {
return $body =~ /$1/ ? 1 : 0;
}
[% header_done = 1 %]
[% END %]
-[%# Display changes to bugs that happened in the last request #%]
+[%# Display a short summary of the change when a bug or attachment is created or updated.
+ # The user will see a toast notification, and verbose messages are hidden by default. #%]
+[% change_short_summary = '' %]
+
[% sentmail = c.flash("last_sent_changes") %]
[% FOREACH item = sentmail %]
[% INCLUDE bug/process/results.html.tmpl
type = item.type
recipient_count = item.recipient_count
%]
+ [% IF loop.first %]
+ [% change_short_summary = BLOCK %]
+ [% IF item.type == 'created' %]
+ [% terms.Bug %] created.
+ [% ELSE %]
+ Changes submitted.
+ [% END %]
+ [%+ PROCESS "bug/process/bugmail.html.tmpl" recipient_count = item.recipient_count %]
+ [% END %]
+ [% END %]
[% END %]
[% sentattachmentmail = c.flash("last_sent_attachment_changes") %]
recipient_count = item.recipient_count
content_type_method = item.content_type_method
%]
+ [% IF loop.first %]
+ [% change_short_summary = BLOCK %]
+ [% IF item.type == 'created' %]
+ Attachment created.
+ [% ELSE %]
+ Attachment updated.
+ [% END %]
+ [%+ PROCESS "bug/process/bugmail.html.tmpl" recipient_count = item.recipient_count %]
+ [% END %]
+ [% END %]
[% END %]
[% INCLUDE bug_modal/edit.html.tmpl %]
<div role="status" id="io-error" style="display:none"></div>
<div role="status" id="floating-message" style="display:none">
- <div id="floating-message-text"></div>
+ <div id="floating-message-text">[% change_short_summary FILTER html %]</div>
</div>
[% WRAPPER bug_modal/module.html.tmpl
width: 235px;
}
+/**
+ * verbose change summary
+ */
+
+.change-summary {
+ display: none;
+}
+
/**
* search navigation
*/
$.scrollTo($('#bottom-actions'));
});
+ // show floating message after creating/updating a bug/attachment
+ if ($('#floating-message-text').text()) {
+ $('#floating-message').fadeIn(250).delay(4000).fadeOut();
+ }
+
// hide floating message when clicked
$('#floating-message')
.click(function(event) {
$sel->click_ok("bottom-save-btn");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_like(qr/\d+ \S $bug_summary/, "crash report added");
-$sel->click_ok("link=bug $bug_id");
-$sel->wait_for_page_to_load_ok(WAIT_TIME);
+go_to_bug($sel, $bug_id);
attribute_is($sel, 'bp-63f096f7-253b-4ee2-ae3d-8bb782090824',
'https://crash-stats.mozilla.org/report/index/63f096f7-253b-4ee2-ae3d-8bb782090824'
);
$sel->click_ok("bottom-save-btn");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_like(qr/\d+ \S $bug_summary/, "cve added");
-$sel->click_ok("link=bug $bug_id");
-$sel->wait_for_page_to_load_ok(WAIT_TIME);
-
+go_to_bug($sel, $bug_id);
attribute_is($sel, 'CVE-2010-2884',
'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-2884');
$sel->click_ok("bottom-save-btn");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_like(qr/\d+ \S $bug_summary/, "svn revision added");
-$sel->click_ok("link=bug $bug_id");
-$sel->wait_for_page_to_load_ok(WAIT_TIME);
-
+go_to_bug($sel, $bug_id);
attribute_is($sel, 'r12345',
'https://viewvc.svn.mozilla.org/vc?view=rev&revision=12345');
# Now create another attachment, and set requestees.
-$sel->click_ok(
- "//a[contains(text(),'Create\n Another Attachment to Bug $bug1_id')]");
+$sel->click_ok("link=Attach File");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is("Create New Attachment for Bug #$bug1_id");
$sel->attach_file('//input[@name="data"]', $config->{attachment_file});
# Create a third attachment, but we now set the MIME type manually.
-$sel->click_ok(
- "//a[contains(text(),'Create\n Another Attachment to Bug $bug1_id')]");
+$sel->click_ok("link=Attach File");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is("Create New Attachment for Bug #$bug1_id");
$sel->attach_file('//input[@name="data"]', $config->{attachment_file});
$sel->is_text_present_ok("Changes submitted for bug $test_bug_1");
# Make sure the correct bug is redisplayed.
-$sel->click_ok("link=bug $test_bug_1");
-$sel->wait_for_page_to_load_ok(WAIT_TIME);
+go_to_bug($sel, $test_bug_1);
$sel->title_like(qr/^$test_bug_1/, "Display bug $test_bug_1");
$sel->is_text_present_ok("I did some work");
$sel->is_text_present_ok("Hours Worked: 2.6");
[% PROCESS global/variables.none.tmpl %]
-<dl>
+<dl class="change-summary attachment">
<dt>
[% IF type == 'created' %]
<a title="[% attachment.description FILTER html %]"
</dd>
</dl>
-<p>
+<p class="change-summary attachment extra">
<a href="[% basepath FILTER none %]attachment.cgi?bugid=[% attachment.bug_id FILTER none %]&action=enter">Create
Another Attachment to [% terms.Bug %] [%+ attachment.bug_id FILTER none %]</a>
</p>
[% USE Bugzilla %]
[% PROCESS global/variables.none.tmpl %]
-<div id="bugmail_summary_[% mailing_bugid FILTER none %]_short">
- [% IF recipient_count > 0 %]
- Email sent to [% recipient_count FILTER html %] recipient[% 's' UNLESS recipient_count == 1 %].
- [% ELSE %]
- No emails were sent.
- [% END %]
-</div>
+[% IF recipient_count > 1 %]
+ Email sent to [% recipient_count FILTER none %] recipients.
+[% ELSIF recipient_count == 1 %]
+ Email sent to 1 recipient.
+[% ELSE %]
+ No emails sent.
+[% END %]
[% Hook.process('title') %]
-<dl>
+<dl class="change-summary bug">
<dt>[% title.$type %]</dt>
<dd>
[% PROCESS "bug/process/bugmail.html.tmpl" mailing_bugid = id %]