5 use Test::More 'tests' => 17;
6 use SGN::Test::Fixture;
7 use SGN::Test::WWW::WebDriver;
11 my $d = SGN::Test::WWW::WebDriver->new();
13 $d->while_logged_in_as( "submitter", sub {
16 $d->get_ok( "/search", "get root url test" );
19 my $out = $d->find_element_ok( "lists_link", "name", "find lists_link" ) ->click();
21 print "Adding new list...\n";
23 $d->find_element_ok( "add_list_input", "id", "find add list input" );
25 my $add_list_input = $d->find_element_ok( "add_list_input", "id",
26 "find add list input test" );
28 $add_list_input->send_keys("new_test_list_accession_validation_fail");
30 $d->find_element_ok( "add_list_button", "id",
31 "find add list button test" )->click();
34 "view_list_new_test_list_accession_validation_fail",
35 "id", "view list test" )->click();
39 $d->find_element_ok( "dialog_add_list_item", "id", "add test list" )
40 ->send_keys("element11\nelement22\nelement33\n");
44 $d->find_element_ok( "dialog_add_list_item_button", "id",
45 "find dialog_add_list_item_button test" )->click();
48 $d->find_element_ok("type_select", "id", "validate list select")->click();
50 $d->find_element_ok("//select[\@id='type_select']/option[\@name='accessions']", 'xpath', "Select 'accessions' as value for list type")->click();
54 $d->find_element_ok( "list_item_dialog_validate", "id",
55 "submit list validate" )->click();
58 my $validation_result = $d->find_element_ok(
59 '//div[@id="validate_accession_error_display"]//div[@class="modal-content"]',
61 "find content of validation modal")->get_attribute('innerHTML');
64 ok($validation_result =~ /List Validation Report: Failed/, "Verify first validation result: 'List Validation Report: Failed'");
65 ok($validation_result =~ /element11/, "Verify first validation result: 'element11'");
66 ok($validation_result =~ /element22/, "Verify first validation result: 'element22'");
67 ok($validation_result =~ /element33/, "Verify first validation result: 'element33'");
71 $d->find_element_ok( "close_missing_accessions_dialog", "id",
72 "find close missing accession dialog button" )->click();