diff --git a/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php b/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php new file mode 100644 index 0000000..de4f39b --- /dev/null +++ b/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php @@ -0,0 +1,87 @@ + 'Configuration translation lists', + 'description' => 'Visit all lists.', + 'group' => 'Configuration translation', + ); + } + + function setUp() { + parent::setUp(); + $permissions = array( + 'translate configuration', + 'administer site configuration', + 'administer contact forms', + 'access site-wide contact form', + 'administer menu', + 'administer taxonomy', + ); + // Create and login user. + $admin_user = $this->drupalCreateUser($permissions); + $this->drupalLogin($admin_user); + } + + function testTranslateOperationInListUI() { + $translate_operation_title = 'Translate'; + + // Simple test for 'Translate' anywhere on the taxonomy list page. + $list_url = 'admin/structure/taxonomy'; + $this->drupalGet($list_url); + $this->assertText($translate_operation_title); + + // Add test vocabulary to decouple looking for Translate operations link + // so it does not test more than necessary. + // Figure out how to add a test vocabulary. + + // Simple test for 'Translate' anywhere on the menu list page. + $list_url = 'admin/structure/menu'; + $this->drupalGet($list_url); + $this->assertText($translate_operation_title); + + // Simple test for translate link for the administration menu. Take this out + // when adding a test menu works. See next chunk. + $translate_link = 'admin/structure/menu/manage/admin/translate'; + $this->assertLinkByHref($translate_link); + + // Add a test menu. + $this->drupalGet('admin/structure/menu/add'); + $menu_name = $this->randomName(16); + $label = $this->randomName(16); + $edit = array( + 'id' => $menu_name, + 'description' => '', + 'label' => $label, + ); + $this->drupalPost('admin/structure/menu/add', $edit, t('Save')); + $this->drupalGet($list_url); + // The above does not work, there is no new menu shown in the verbose + // web feedback from running the tests locally. + + // Guess what translate url will be added for the test menu and find it. + $translate_link = 'admin/structure/menu/manage/' . $menu_name . '/translate'; + $this->assertLinkByHref($translate_link); + } + +}