Problem/Motivation

  • Fix an error while clicking a Delete button of VPC in drupal/aws_cloud:
      @api @javascript
      Scenario: Delete the VPC                                                           # features/tmp.20240305_010039.xd3iol/AWS-ATDD-03-07-OperateVPCs.feature:53
        Given I am logged in as user "BDD_user_1b06966"                                  # Drupal\Tests\cloud\Behat\features\bootstrap\FeatureContext::iAmLoggedInAsUser()
        When I visit "/clouds/aws_cloud/bdd_aws_1b06966_ap_northeast_1/vpc"              # Drupal\DrupalExtension\Context\MinkContext::assertAtPath()
        And I click "Refresh"                                                            # Drupal\DrupalExtension\Context\MinkContext::assertClick()
        And I should see the link "BDD_VPC_1b06966_Updated_Operate"                      # Drupal\DrupalExtension\Context\MinkContext::assertLinkVisible()
        And I wait 500 milliseconds                                                      # Drupal\Tests\cloud\Behat\features\bootstrap\FeatureContext::waitMilliSeconds()
        And I click "BDD_VPC_1b06966_Updated_Operate"                                    # Drupal\DrupalExtension\Context\MinkContext::assertClick()
        And the url should match "/clouds/aws_cloud/bdd_aws_1b06966_ap_northeast_1/vpc/" # Drupal\DrupalExtension\Context\MinkContext::assertUrlRegExp()
        And I should see "BDD_VPC_1b06966_Updated_Operate" in the "page_header"          # Drupal\DrupalExtension\Context\MinkContext::assertRegionText()
        And I press "Others"                                                             # Drupal\DrupalExtension\Context\MinkContext::pressButton()
        And I should see "BDD_user_1b06966" in the "Authored by"                         # Drupal\DrupalExtension\Context\MinkContext::assertRegionText()
        And I should see neither error nor warning messages                              # Drupal\DrupalExtension\Context\MessageContext::assertErrorWarningNotVisible()
        And I click "Delete" in the "actions"                                            # Drupal\DrupalExtension\Context\MinkContext::assertRegionLinkFollow()
        And the url should match "/delete"                                               # Drupal\DrupalExtension\Context\MinkContext::assertUrlRegExp()
          Current page "/clouds/aws_cloud/bdd_aws_1b06966_ap_northeast_1/vpc/5" does not match the regex ""/delete"". (Behat\Mink\Exception\ExpectationException)
        │
        │  Screenshot at: sites/screenshots/030524-101644_AWS-ATDD-03-07-OperateVPCs_66-FAIL.png
        │
        └─ @AfterStep # Drupal\Tests\cloud\Behat\features\bootstrap\FeatureContext::takeScreenshotOnFailure()
        And I press "Delete"                                                             # Drupal\DrupalExtension\Context\MinkContext::pressButton()
        Then I should be on "/clouds/aws_cloud/bdd_aws_1b06966_ap_northeast_1/vpc"       # Drupal\DrupalExtension\Context\MinkContext::assertPageAddress()
        And I should see the success message "has been deleted"                          # Drupal\DrupalExtension\Context\MessageContext::assertSuccessMessage()
        And I should see neither error nor warning messages                              # Drupal\DrupalExtension\Context\MessageContext::assertErrorWarningNotVisible()
        And I click "Refresh"                                                            # Drupal\DrupalExtension\Context\MinkContext::assertClick()
        And I should not see the link "BDD_VPC_1b06966_Updated_Operate"   
    
      Scenario: Delete the VPC                                                           # features/tmp.20240305_135710.3wkher/AWS-ATDD-04-04-OperateCarrierGateways.feature:83
        Given I am logged in as user "BDD_user_ed246f8"                                  # Drupal\Tests\cloud\Behat\features\bootstrap\FeatureContext::iAmLoggedInAsUser()
        When I visit "/clouds/aws_cloud/bdd_aws_ed246f8_ap_northeast_1/vpc"              # Drupal\DrupalExtension\Context\MinkContext::assertAtPath()
        And I click "Refresh"                                                            # Drupal\DrupalExtension\Context\MinkContext::assertClick()
        And I should see the link "BDD_VPC_ed246f8_Operate"                              # Drupal\DrupalExtension\Context\MinkContext::assertLinkVisible()
        And I wait 500 milliseconds                                                      # Drupal\Tests\cloud\Behat\features\bootstrap\FeatureContext::waitMilliSeconds()
        And I click "BDD_VPC_ed246f8_Operate"                                            # Drupal\DrupalExtension\Context\MinkContext::assertClick()
        And the url should match "/clouds/aws_cloud/bdd_aws_ed246f8_ap_northeast_1/vpc/" # Drupal\DrupalExtension\Context\MinkContext::assertUrlRegExp()
        And I should see "BDD_VPC_ed246f8_Operate" in the "page_header"                  # Drupal\DrupalExtension\Context\MinkContext::assertRegionText()
        And I press "Others"                                                             # Drupal\DrupalExtension\Context\MinkContext::pressButton()
        And I should see "BDD_user_ed246f8" in the "Authored by"                         # Drupal\DrupalExtension\Context\MinkContext::assertRegionText()
        And I should see neither error nor warning messages                              # Drupal\DrupalExtension\Context\MessageContext::assertErrorWarningNotVisible()
        And I click "Delete" in the "actions"                                            # Drupal\DrupalExtension\Context\MinkContext::assertRegionLinkFollow()
        And the url should match "/delete"                                               # Drupal\DrupalExtension\Context\MinkContext::assertUrlRegExp()
          Current page "/clouds/aws_cloud/bdd_aws_ed246f8_ap_northeast_1/vpc/10" does not match the regex ""/delete"". (Behat\Mink\Exception\ExpectationException)
        │
        │  Screenshot at: sites/screenshots/030524-233035_AWS-ATDD-04-04-OperateCarrierGateways_96-FAIL.png
        │
        └─ @AfterStep # Drupal\Tests\cloud\Behat\features\bootstrap\FeatureContext::takeScreenshotOnFailure()
        And I press "Delete"                                                             # Drupal\DrupalExtension\Context\MinkContext::pressButton()
        Then I should be on "/clouds/aws_cloud/bdd_aws_ed246f8_ap_northeast_1/vpc"       # Drupal\DrupalExtension\Context\MinkContext::assertPageAddress()
        And I should see the success message "has been deleted"                          # Drupal\DrupalExtension\Context\MessageContext::assertSuccessMessage()
        And I should see neither error nor warning messages                              # Drupal\DrupalExtension\Context\MessageContext::assertErrorWarningNotVisible()
        And I click "Refresh"                                                            # Drupal\DrupalExtension\Context\MinkContext::assertClick()
        And I should not see the link "BDD_VPC_ed246f8_Operate"
    

Issue fork cloud-3425894

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

yas created an issue. See original summary.

yas’s picture

Issue summary: View changes

yas’s picture

Status: Needs work » Needs review

@baldwinlouie

Can you please review the patch? Thanks!

yas’s picture

Issue summary: View changes
baldwinlouie’s picture

Status: Needs review » Reviewed & tested by the community

@yas, this patch looks good to me!

yas’s picture

@baldwinlouie

Thank you for review. I added a scenario step And I wait {{ wait }} milliseconds so that the tests should be more robust. I'll merge the patch to 6.x and 7.x, and close this issue as Fixed.

  • yas committed 24f7dcb9 on 7.x
    Issue #3425894 by yas, baldwinlouie: Fix an error while clicking a '...

  • yas committed e236305a on 6.x
    Issue #3425894 by yas, baldwinlouie: Fix an error while clicking a '...
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.