diff --git a/CHANGES.md b/CHANGES.md index 6c4ff677cf6..f20a0dcb079 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,5 @@ #5.0.30 20??-??-?? + - 2018-08-30 Fixed bug#[14030](https://bugs.otrs.org/show_bug.cgi?id=14030) - Values of the type field are translated in the bulk view. - 2018-08-27 Fixed bug#[14025](https://bugs.otrs.org/show_bug.cgi?id=14025) - backup.pl may delete a backup it just created. - 2018-08-27 Fixed bug#[13767](https://bugs.otrs.org/show_bug.cgi?id=13767) - Search result wrong displayed when there is only one result in IE 11. - 2018-08-17 Fixed bug#[13987](https://bugs.otrs.org/show_bug.cgi?id=13987) - The value typed in e.g. customer user is deleted frequently, if already one customer user is selected. diff --git a/Kernel/Modules/AgentTicketBulk.pm b/Kernel/Modules/AgentTicketBulk.pm index 285f6b3f06b..c2663a8b2a6 100644 --- a/Kernel/Modules/AgentTicketBulk.pm +++ b/Kernel/Modules/AgentTicketBulk.pm @@ -145,6 +145,7 @@ sub Run { Data => \%TypeList, SelectedID => $GetParam{TypeID}, PossibleNone => 1, + Translation => 0, }; } diff --git a/scripts/test/Selenium/Agent/AgentTicketBulk.t b/scripts/test/Selenium/Agent/AgentTicketBulk.t index f5507bf9047..051d9d79a4a 100644 --- a/scripts/test/Selenium/Agent/AgentTicketBulk.t +++ b/scripts/test/Selenium/Agent/AgentTicketBulk.t @@ -62,7 +62,13 @@ $Selenium->RunTest( }, ); - # Get needed variables. + # Enable ticket type feature. + $Helper->ConfigSettingChange( + Valid => 1, + Key => 'Ticket::Type', + Value => 1, + ); + my $RandomNumber = $Helper->GetRandomNumber(); my $Success; @@ -87,9 +93,13 @@ $Selenium->RunTest( push @GroupNames, $GroupName; } - # Create test user for login. + # Defined user language for testing if message is being translated correctly. + my $Language = "de"; + + # create test user and login my $TestUserLogin = $Helper->TestUserCreate( - Groups => [ 'admin', 'users', @GroupNames ], + Groups => [ 'admin', 'users', @GroupNames ], + Language => $Language, ) || die "Did not get test user"; # get test user ID @@ -287,7 +297,7 @@ $Selenium->RunTest( $Selenium->find_element("//input[\@value='$Tickets[0]->{TicketID}']")->click(); $Selenium->find_element("//input[\@value='$Tickets[1]->{TicketID}']")->click(); $Selenium->find_element("//input[\@value='$Tickets[2]->{TicketID}']")->click(); - $Selenium->find_element( "Bulk", 'link_text' )->VerifiedClick(); + $Selenium->find_element( "#BulkAction", 'css' )->click(); # switch to bulk window $Selenium->WaitFor( WindowCount => 2 ); @@ -308,7 +318,24 @@ $Selenium->RunTest( $Element->is_displayed(); } - # click on 'Undo & close' link + # Check if ticket type is not translated. + # For more information see bug #14030. + $Self->Is( + $Selenium->execute_script("return \$('#TypeID option[value=1]').text()"), + "Unclassified", + "On load - Ticket type is not translated", + ); + + $Selenium->execute_script("\$('#PriorityID').val('4').trigger('redraw.InputField').trigger('change');"); + $Selenium->WaitFor( JavaScript => 'return typeof($) === "function" && !$(".AJAXLoader:visible").length' ); + + $Self->Is( + $Selenium->execute_script("return \$('#TypeID option[value=1]').text()"), + "Unclassified", + "After change - Ticket type is not translated", + ); + + # Click on 'Undo & close' link. $Selenium->find_element( ".UndoClosePopup", 'css' )->click(); # return to status view @@ -330,7 +357,7 @@ $Selenium->RunTest( $Selenium->find_element("//input[\@value='$Tickets[2]->{TicketID}']")->click(); $Selenium->find_element("//input[\@value='$Tickets[6]->{TicketID}']")->click(); - $Selenium->find_element( "Bulk", 'link_text' )->click(); + $Selenium->find_element( "#BulkAction", 'css' )->click(); # switch to bulk window $Selenium->WaitFor( WindowCount => 2 ); @@ -338,14 +365,23 @@ $Selenium->RunTest( $Selenium->switch_to_window( $Handles->[1] ); # wait until page has loaded, if necessary - $Selenium->WaitFor( JavaScript => 'return typeof($) === "function" && $("#StateID").length' ); + $Selenium->WaitFor( + JavaScript => + 'return typeof(Core) == "object" && typeof(Core.App) == "object" && Core.App.PageLoadComplete' + ); - # check data + my $LanguageObject = Kernel::Language->new( + UserLanguage => $Language, + ); + + # Check data. my @ExpectedMessages = ( - "The following tickets were ignored because they are locked by another agent or you don't have write access to these tickets: " - . $Tickets[2]->{TicketNumber} . ", " - . $Tickets[6]->{TicketNumber} . ".", - "The following tickets were locked: " . $Tickets[1]->{TicketNumber} . ".", + $LanguageObject->Translate( + "The following tickets were ignored because they are locked by another agent or you don\'t have write access to these tickets: %s.", + $Tickets[2]->{TicketNumber} . ", " + . $Tickets[6]->{TicketNumber} + ), + $LanguageObject->Translate( "The following tickets were locked: %s.", $Tickets[1]->{TicketNumber} ), ); for my $ExpectedMessage (@ExpectedMessages) { $Self->True( @@ -397,7 +433,7 @@ $Selenium->RunTest( $Selenium->find_element("//input[\@value='$Tickets[3]->{TicketID}']")->click(); $Selenium->find_element("//input[\@value='$Tickets[4]->{TicketID}']")->click(); $Selenium->find_element("//input[\@value='$Tickets[5]->{TicketID}']")->click(); - $Selenium->find_element( "Bulk", 'link_text' )->click(); + $Selenium->find_element( "#BulkAction", 'css' )->click(); # Switch to bulk window. $Selenium->WaitFor( WindowCount => 2 );