Commit 97a7a9e1 authored by l26yan's avatar l26yan
Browse files

ISTWCMS-4794 Add test for profiles and re-arrange profiles views

parent 67fcdc02
......@@ -1984,6 +1984,37 @@ class UwWcmsBasicTest extends BrowserTestBase {
// Validate new content has been created with same name.
$this->assertSession()->pageTextContains('Profile ' . $profile_name . ' has been created.');
// Check profiles listing view.
$this->drupalGet('profiles');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('Profiles');
$this->assertSession()->pageTextContains('Name');
$this->assertSession()->pageTextContains('Limit to profiles where the name matches');
$this->assertFieldByXPath('//input[@type="text" and @id="edit-title"]', NULL, 'Input field exists.');
$this->assertSession()->pageTextContains('Types');
$this->assertSession()->pageTextContains('Limit to profiles where the type is one or more of');
$this->assertSession()->buttonExists('Apply filters');
// Check rearrange profiles.
$this->drupalGet('admin/rearrange-profiles');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('Published');
$this->assertOptionSelected('edit-status', '- Any -');
$this->assertSession()->buttonExists('Apply filters');
// Check dashboard profile rearrange link.
$this->drupalGet('dashboard/my_dashboard');
$this->assertSession()->statusCodeEquals(200);
$rearranges = $this->getSession()->getPage()->findAll('xpath', "//a[contains(text(), 'Rearrange')]");
$this->assertEquals(base_path() . 'admin/rearrange-profiles', $rearranges[1]->getAttribute('href'));
// Make sure site manager's rearrange for profile is checked.
$this->drupalGet('admin/content-access');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->checkboxChecked('edit-permissions-profile-rearrange-site-manager');
$this->assertSession()->checkboxNotChecked('edit-permissions-profile-rearrange-content-editor');
$this->assertSession()->checkboxNotChecked('edit-permissions-profile-rearrange-content-author');
// Check pathauto pattern to make sure they are in same row.
$this->drupalGet('admin/config/search/path/patterns');
$this->assertSession()->statusCodeEquals(200);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment