Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Fixed: Values of the type field are translated in the bulk view (bug#…
Browse files Browse the repository at this point in the history
…14030).
  • Loading branch information
zilibasic authored and milanrakic committed Aug 30, 2018
1 parent 452a57b commit abb193c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 13 deletions.
1 change: 1 addition & 0 deletions 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.
Expand Down
1 change: 1 addition & 0 deletions Kernel/Modules/AgentTicketBulk.pm
Expand Up @@ -145,6 +145,7 @@ sub Run {
Data => \%TypeList,
SelectedID => $GetParam{TypeID},
PossibleNone => 1,
Translation => 0,
};
}

Expand Down
62 changes: 49 additions & 13 deletions scripts/test/Selenium/Agent/AgentTicketBulk.t
Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -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 );
Expand All @@ -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
Expand All @@ -330,22 +357,31 @@ $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 );
$Handles = $Selenium->get_window_handles();
$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(
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit abb193c

Please sign in to comment.