Skip to content
Snippets Groups Projects
Commit fb88a654 authored by Priyanka   Khedekar's avatar Priyanka Khedekar Committed by Yas Naoi
Browse files

Issue #3118445 by Vaishali Parmar, yas: Refactor $this->assertNoText to...

Issue #3118445 by Vaishali Parmar, yas: Refactor $this->assertNoText to $this->assertSession()->pageTextNotContains() (2) (K8s)
parent 4f68d592
No related branches found
No related tags found
No related merge requests found
...@@ -424,10 +424,7 @@ class ElasticIpTest extends AwsCloudTestCase { ...@@ -424,10 +424,7 @@ class ElasticIpTest extends AwsCloudTestCase {
$this->assertSession()->pageTextContains($this->t('Updated Elastic IPs.')); $this->assertSession()->pageTextContains($this->t('Updated Elastic IPs.'));
// Make sure listing. // Make sure listing.
for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) {
$this->assertSession()->pageTextContains($add[$i]['name'], $this->assertSession()->pageTextContains($add[$i]['name']);
$this->t('Edit | List | Make sure w/ Listing: @name', [
'@name' => $add[$i]['name'],
]));
} }
// Make sure detailed and edit view. // Make sure detailed and edit view.
......
...@@ -308,10 +308,7 @@ class ImageTest extends AwsCloudTestCase { ...@@ -308,10 +308,7 @@ class ImageTest extends AwsCloudTestCase {
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('warning')); $this->assertSession()->pageTextNotContains($this->t('warning'));
$this->assertSession()->pageTextNotContains($data['name'], $this->assertSession()->pageTextNotContains($data['name']);
$this->t('Edit | List | Make sure w/ Listing: @name', [
'@name' => $data['name'],
]));
// Click 'Refresh'. // Click 'Refresh'.
$this->clickLink($this->t('Refresh')); $this->clickLink($this->t('Refresh'));
......
...@@ -70,7 +70,7 @@ class KeyPairTest extends AwsCloudTestCase { ...@@ -70,7 +70,7 @@ class KeyPairTest extends AwsCloudTestCase {
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Add | Make sure w/o Warnings')); $this->assertSession()->pageTextContains($this->t('warning'));
$this->assertSession()->pageTextContains( $this->assertSession()->pageTextContains(
$this->t('AWS Cloud Key Pair @key_pair_name', [ $this->t('AWS Cloud Key Pair @key_pair_name', [
'@key_pair_name' => $add[$i]['key_pair_name'], '@key_pair_name' => $add[$i]['key_pair_name'],
......
...@@ -91,8 +91,8 @@ class CloudServerTemplateTest extends K8sTestCase { ...@@ -91,8 +91,8 @@ class CloudServerTemplateTest extends K8sTestCase {
$this->t('Save')); $this->t('Save'));
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->pageTextContains( $this->assertSession()->pageTextContains(
$this->t('Created the @name cloud server template', [ $this->t('Created the @name cloud server template', [
'@name' => $add[$i]['name[0][value]'], '@name' => $add[$i]['name[0][value]'],
...@@ -103,8 +103,8 @@ class CloudServerTemplateTest extends K8sTestCase { ...@@ -103,8 +103,8 @@ class CloudServerTemplateTest extends K8sTestCase {
// List test. // List test.
$this->drupalGet("/clouds/design/server_template/$cloud_context"); $this->drupalGet("/clouds/design/server_template/$cloud_context");
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
// Edit test. // Edit test.
$pods = $this->createPodTestFormData(self::CLOUD_SERVER_TEMPLATES_REPEAT_COUNT, $this->namespace); $pods = $this->createPodTestFormData(self::CLOUD_SERVER_TEMPLATES_REPEAT_COUNT, $this->namespace);
...@@ -125,8 +125,8 @@ class CloudServerTemplateTest extends K8sTestCase { ...@@ -125,8 +125,8 @@ class CloudServerTemplateTest extends K8sTestCase {
); );
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->pageTextContains( $this->assertSession()->pageTextContains(
$this->t('Saved the @name cloud server template.', $this->t('Saved the @name cloud server template.',
[ [
...@@ -150,21 +150,17 @@ class CloudServerTemplateTest extends K8sTestCase { ...@@ -150,21 +150,17 @@ class CloudServerTemplateTest extends K8sTestCase {
[], [],
$this->t('Delete')); $this->t('Delete'));
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
} }
// Make sure the deleted templates are not listed anymore. // Make sure the deleted templates are not listed anymore.
$this->drupalGet("/clouds/design/server_template/$cloud_context"); $this->drupalGet("/clouds/design/server_template/$cloud_context");
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
for ($j = 0; $j < self::CLOUD_SERVER_TEMPLATES_REPEAT_COUNT; $j++) { for ($j = 0; $j < self::CLOUD_SERVER_TEMPLATES_REPEAT_COUNT; $j++) {
$this->assertSession()->pageTextNotContains( $this->assertSession()->pageTextNotContains($edit[$j]['name[0][value]']);
$this->t('Make sure w/ Listing @num: @name', [
'@num' => $j + 1,
'@name' => $edit[$j]['name[0][value]'],
]));
} }
} }
...@@ -203,8 +199,8 @@ class CloudServerTemplateTest extends K8sTestCase { ...@@ -203,8 +199,8 @@ class CloudServerTemplateTest extends K8sTestCase {
$this->t('Save')); $this->t('Save'));
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->pageTextContains( $this->assertSession()->pageTextContains(
$this->t('Created the @name cloud server template', [ $this->t('Created the @name cloud server template', [
'@name' => $add[$i]['name[0][value]'], '@name' => $add[$i]['name[0][value]'],
...@@ -243,8 +239,8 @@ class CloudServerTemplateTest extends K8sTestCase { ...@@ -243,8 +239,8 @@ class CloudServerTemplateTest extends K8sTestCase {
); );
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->pageTextContains( $this->assertSession()->pageTextContains(
$this->t('@object @name launched.', $this->t('@object @name launched.',
[ [
......
...@@ -51,8 +51,8 @@ class K8sCloudConfigTest extends K8sTestCase { ...@@ -51,8 +51,8 @@ class K8sCloudConfigTest extends K8sTestCase {
// List k8s. // List k8s.
$this->drupalGet('/admin/structure/cloud_config'); $this->drupalGet('/admin/structure/cloud_config');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
// Add a new Config information. // Add a new Config information.
$add = $this->createCloudConfigTestFormData(self::K8S_CLOUD_CONFIG_REPEAT_COUNT); $add = $this->createCloudConfigTestFormData(self::K8S_CLOUD_CONFIG_REPEAT_COUNT);
...@@ -61,8 +61,8 @@ class K8sCloudConfigTest extends K8sTestCase { ...@@ -61,8 +61,8 @@ class K8sCloudConfigTest extends K8sTestCase {
unset($add[$i]['cloud_context']); unset($add[$i]['cloud_context']);
$this->drupalGet('/admin/structure/cloud_config/add'); $this->drupalGet('/admin/structure/cloud_config/add');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
// Test if API server field is empty. // Test if API server field is empty.
$_add = $add; $_add = $add;
...@@ -109,8 +109,8 @@ class K8sCloudConfigTest extends K8sTestCase { ...@@ -109,8 +109,8 @@ class K8sCloudConfigTest extends K8sTestCase {
); );
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->pageTextContains($this->t('Created the cloud service provider: @label.', $this->assertSession()->pageTextContains($this->t('Created the cloud service provider: @label.',
['@label' => $add[$i]['name[0][value]']] ['@label' => $add[$i]['name[0][value]']]
)); ));
...@@ -118,22 +118,22 @@ class K8sCloudConfigTest extends K8sTestCase { ...@@ -118,22 +118,22 @@ class K8sCloudConfigTest extends K8sTestCase {
// Make sure listing for '/admin/structure/cloud_config'. // Make sure listing for '/admin/structure/cloud_config'.
$this->drupalGet('/admin/structure/cloud_config'); $this->drupalGet('/admin/structure/cloud_config');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->linkExists($add[$i]['name[0][value]']); $this->assertSession()->linkExists($add[$i]['name[0][value]']);
// Make sure listing for '/clouds'. // Make sure listing for '/clouds'.
$this->drupalGet('/clouds'); $this->drupalGet('/clouds');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->linkExists($add[$i]['name[0][value]']); $this->assertSession()->linkExists($add[$i]['name[0][value]']);
// Make sure listing for '/admin/config/services/cloud/k8s'. // Make sure listing for '/admin/config/services/cloud/k8s'.
$this->drupalGet('/admin/config/services/cloud/k8s'); $this->drupalGet('/admin/config/services/cloud/k8s');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->linkExists($add[$i]['name[0][value]']); $this->assertSession()->linkExists($add[$i]['name[0][value]']);
} }
...@@ -149,28 +149,28 @@ class K8sCloudConfigTest extends K8sTestCase { ...@@ -149,28 +149,28 @@ class K8sCloudConfigTest extends K8sTestCase {
$this->t('Save') $this->t('Save')
); );
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
// Make sure listing for '/admin/structure/cloud_config'. // Make sure listing for '/admin/structure/cloud_config'.
$this->drupalGet('/admin/structure/cloud_config'); $this->drupalGet('/admin/structure/cloud_config');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->linkExists($edit[$i]['name[0][value]']); $this->assertSession()->linkExists($edit[$i]['name[0][value]']);
// Make sure listing for '/clouds'. // Make sure listing for '/clouds'.
$this->drupalGet('/clouds'); $this->drupalGet('/clouds');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->linkExists($edit[$i]['name[0][value]']); $this->assertSession()->linkExists($edit[$i]['name[0][value]']);
// Make sure listing for '/admin/config/services/cloud/k8s'. // Make sure listing for '/admin/config/services/cloud/k8s'.
$this->drupalGet('/admin/config/services/cloud/k8s'); $this->drupalGet('/admin/config/services/cloud/k8s');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->linkExists($edit[$i]['name[0][value]']); $this->assertSession()->linkExists($edit[$i]['name[0][value]']);
} }
...@@ -184,8 +184,8 @@ class K8sCloudConfigTest extends K8sTestCase { ...@@ -184,8 +184,8 @@ class K8sCloudConfigTest extends K8sTestCase {
); );
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->pageTextContains($this->t('The cloud service provider @label has been deleted.', $this->assertSession()->pageTextContains($this->t('The cloud service provider @label has been deleted.',
['@label' => $edit[$i]['name[0][value]']] ['@label' => $edit[$i]['name[0][value]']]
)); ));
...@@ -197,22 +197,22 @@ class K8sCloudConfigTest extends K8sTestCase { ...@@ -197,22 +197,22 @@ class K8sCloudConfigTest extends K8sTestCase {
// Make sure listing for '/admin/structure/cloud_config'. // Make sure listing for '/admin/structure/cloud_config'.
$this->drupalGet('/admin/structure/cloud_config'); $this->drupalGet('/admin/structure/cloud_config');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->linkNotExists($edit[$k]['name[0][value]']); $this->assertSession()->linkNotExists($edit[$k]['name[0][value]']);
// Make sure listing for '/clouds'. // Make sure listing for '/clouds'.
$this->drupalGet('/clouds'); $this->drupalGet('/clouds');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->linkNotExists($edit[$k]['name[0][value]']); $this->assertSession()->linkNotExists($edit[$k]['name[0][value]']);
// Make sure listing for '/admin/config/services/cloud/k8s'. // Make sure listing for '/admin/config/services/cloud/k8s'.
$this->drupalGet('/admin/config/services/cloud/k8s'); $this->drupalGet('/admin/config/services/cloud/k8s');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Notice')); $this->assertSession()->pageTextNotContains($this->t('Notice'));
$this->assertSession()->pageTextNotContains($this->t('Make sure w/o Warnings')); $this->assertSession()->pageTextNotContains($this->t('Warning'));
$this->assertSession()->linkNotExists($edit[$k]['name[0][value]']); $this->assertSession()->linkNotExists($edit[$k]['name[0][value]']);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment