Commit 6ec87cbe authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-4775 Check pathauto pattern for Contact and Profile content types

parent 63de3dd9
......@@ -1572,6 +1572,21 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->submitForm($req_fields, 'Save');
// Contact successfully created when only required fields are submitted.
$this->assertSession()->statusCodeEquals(200);
// Check pathauto pattern to make sure they are in same row.
$this->drupalGet('admin/config/search/path/patterns');
$this->assertSession()->statusCodeEquals(200);
$elements = $this->xpath('//div[@id="block-uw-theme-admin-mainpagecontent"]
//table/tbody/tr[@data-drupal-selector="edit-entities-uw-path-contact"]/td');
$expected_items = [
'Contact path pattern',
'contacts/[node:title]',
'Content',
'The node bundle is uw_ct_contact',
];
foreach ($expected_items as $key => $value) {
$this->assertEqual($elements[$key]->getText(), $value);
}
}
/**
......@@ -1629,6 +1644,21 @@ class UwWcmsBasicTest extends BrowserTestBase {
// Validate new content has been created with same name.
$this->assertSession()->pageTextContains('Profile ' . $profile_name . ' has been created.');
// Check pathauto pattern to make sure they are in same row.
$this->drupalGet('admin/config/search/path/patterns');
$this->assertSession()->statusCodeEquals(200);
$elements = $this->xpath('//div[@id="block-uw-theme-admin-mainpagecontent"]
//table/tbody/tr[@data-drupal-selector="edit-entities-uw-path-profile"]/td');
$expected_items = [
'Profile path pattern',
'profiles/[node:title]',
'Content',
'The node bundle is uw_ct_profile',
];
foreach ($expected_items as $key => $value) {
$this->assertEqual($elements[$key]->getText(), $value);
}
}
/**
......
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