Skip to content

Commit

Permalink
Merge pull request #3965 from 3scale/refactor-deprecations
Browse files Browse the repository at this point in the history
Refactor deprecations in Cucumber tests
  • Loading branch information
mayorova authored Jan 15, 2025
2 parents b2462b3 + d6476ab commit f0e20bc
Show file tree
Hide file tree
Showing 75 changed files with 167 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ build-envs:
environment:
DB: oracle
DATABASE_URL: oracle-enhanced://rails:railspass@127.0.0.1:1521/systempdb
CAPYBARA_MAX_WAIT_TIME: 20
CAPYBARA_MAX_WAIT_TIME: 30

##################################### CIRCLECI COMMANDS ############################################

Expand Down
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignore:
- "features/**/*"
- "test/**/*"
- "spec/**/*"
9 changes: 6 additions & 3 deletions features/api/alerts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ Feature: Audience > Applications > Alerts

Scenario: Deleting alerts
Given they go to the alerts page
When they press "Delete" in the 1st row and confirm the dialog
When they press "Delete" in the 1st row
And confirm the dialog
Then they should see the following table:
| Account | Application | Message | Level | Time (UTC) | |
| Jane | Application 1 | foos: 18 of 20 | ≥ 90 % | 14 Oct 2010 11:11:00 UTC | Delete\nRead |
Expand All @@ -60,7 +61,8 @@ Feature: Audience > Applications > Alerts

Scenario: Marking all alerts as read
Given they go to the alerts page
When they select toolbar action "Mark all as read" and confirm the dialog
When they select toolbar action "Mark all as read"
And confirm the dialog
Then they should see the following table:
| Account | Application | Message | Level | Time (UTC) | |
| Jane | Application 1 | foos: 30 of 20 | ≥ 150 % | 15 Oct 2010 14:14:00 UTC | Delete |
Expand All @@ -70,5 +72,6 @@ Feature: Audience > Applications > Alerts

Scenario: Deleting all alerts
Given they go to the alerts page
When they select toolbar action "Delete all" and confirm the dialog
When they select toolbar action "Delete all"
And confirm the dialog
Then they should see "All clear"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Feature: Application plan Metrics, Methods, Limits & Pricing Rules
And the following application plan:
| Product | Name | Default |
| Dice rolls | Free | true |
# And the provider has plans ready for signups
And the product has the following metrics:
| Friendly name |
| Single rolls |
Expand Down
3 changes: 2 additions & 1 deletion features/api/backend_usages/index.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ Feature: Product > Integration > Backends

Scenario: Deleting a backend config
When they go to the backends of product "My API"
And follow "Delete config with Backend 1" and confirm the dialog
And follow "Delete config with Backend 1"
And confirm the dialog
Then they should see the flash message "The Backend was removed from the Product"
And should see the following table:
| Name | Private base URL | Public path |
Expand Down
9 changes: 6 additions & 3 deletions features/api/metrics/edit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Feature: Product > Integration > Metrics > Edit

Scenario: Deleting a method
Given they go to the edit page of method "Carbonara"
When they follow "Delete" and confirm the dialog
When they follow "Delete"
And confirm the dialog
Then should see the flash message "The method was deleted"
And should not see method "Carbonara"

Expand All @@ -50,7 +51,8 @@ Feature: Product > Integration > Metrics > Edit

Scenario: Deleting a metric
Given they go to the edit page of metric "Pasta"
When they follow "Delete" and confirm the dialog
When they follow "Delete"
And confirm the dialog
Then should see the flash message "The metric was deleted"
And should not see metric "Pasta"

Expand All @@ -61,6 +63,7 @@ Feature: Product > Integration > Metrics > Edit
Scenario: Cannot delete a metric used in the latest gateway configuration
Given metric "Pasta" is used in the latest gateway configuration
When they go to the edit page of metric "Pasta"
And follow "Delete" and confirm the dialog
And follow "Delete"
And confirm the dialog
Then should see the flash message "Metric is used by the latest gateway configuration and cannot be deleted"
And should see metric "Pasta"
9 changes: 6 additions & 3 deletions features/api/services/alerts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ Feature: Product > Analytics > Alerts

Scenario: Deleting alerts
Given they go to the alerts of "My Product"
When they press "Delete" in the 1st row and confirm the dialog
When they press "Delete" in the 1st row
And confirm the dialog
Then they should see the following table:
| Account | Application | Message | Level | Time (UTC) | |
| Bob | Bob App | foos: 18 of 20 | ≥ 90 % | 14 Oct 2010 11:11:00 UTC | Delete\nRead |
Expand All @@ -65,7 +66,8 @@ Feature: Product > Analytics > Alerts

Scenario: Marking all alerts as read
Given they go to the alerts of "My Product"
When they select toolbar action "Mark all as read" and confirm the dialog
When they select toolbar action "Mark all as read"
And confirm the dialog
Then they should see the following table:
| Account | Application | Message | Level | Time (UTC) | |
| Bob | Bob App | foos: 30 of 20 | ≥ 150 % | 15 Oct 2010 14:14:00 UTC | Delete |
Expand All @@ -75,5 +77,6 @@ Feature: Product > Analytics > Alerts

Scenario: Deleting all alerts
Given they go to the alerts of "My Product"
When they select toolbar action "Delete all" and confirm the dialog
When they select toolbar action "Delete all"
And confirm the dialog
Then they should see "All clear"
4 changes: 2 additions & 2 deletions features/api/services/applications/new.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Product > Applications > New

Background:
Given a provider
And the provider has multiple applications enabled
And the provider has "multiple_applications" visible
And a product "My API"
And the following application plan:
| Product | Name |
Expand Down Expand Up @@ -97,7 +97,7 @@ Feature: Product > Applications > New

Rule: Multiple applications denied
Background:
Given the provider has multiple applications disabled
Given the provider has "multiple_applications" denied

Scenario: Manual navigation
Given they go to product "My API" applications page
Expand Down
4 changes: 2 additions & 2 deletions features/buyers/accounts/applications/new.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Audience > Accounts > Listing > Account > Applications > New

Background:
Given a provider
And the provider has multiple applications enabled
And the provider has "multiple_applications" visible
And a product "My API"
And the following application plan:
| Product | Name |
Expand Down Expand Up @@ -98,7 +98,7 @@ Feature: Audience > Accounts > Listing > Account > Applications > New

Rule: Multiple applications denied
Background:
Given the provider has multiple applications disabled
Given the provider has "multiple_applications" denied

Scenario: Manual navigation
Given they go to buyer "Jane" applications page
Expand Down
21 changes: 14 additions & 7 deletions features/buyers/accounts/bulk_operations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ Feature: Buyer accounts bulk operations
And select bulk action "Send email"
And fill in "Subject" with "This is the subject"
And fill in "Body" with "This is the body"
And press "Send" and confirm the dialog
And press "Send"
And confirm the dialog
Then I should see "Successfully sent 2 emails."
Then "alice@example.com" should receive 1 email
Then "bob@example.com" should receive 1 email
Expand All @@ -106,7 +107,8 @@ Feature: Buyer accounts bulk operations
And item "Bob" is selected
And select bulk action "Change account plan"
And select "Awesome" from "Plan"
And press "Change plan" and confirm the dialog
And press "Change plan"
And confirm the dialog
Then should see "Successfully changed the plan of 2 accounts"
And the table should contain the following:
| Group/Org. | Plan |
Expand All @@ -127,7 +129,8 @@ Feature: Buyer accounts bulk operations
And item "Bob" is selected
And select bulk action "Change state"
And select "Make pending" from "Action"
And press "Change state" and confirm the dialog within the modal
And press "Change state" within the modal
And confirm the dialog
Then should see "Successfully changed the state of 2 accounts"
And the table should contain the following:
| Group/Org. | State |
Expand All @@ -143,7 +146,8 @@ Feature: Buyer accounts bulk operations
And select bulk action "Send email"
And fill in "Subject" with "Error"
And fill in "Body" with "This will fail"
And press "Send" and confirm the dialog
And press "Send"
And confirm the dialog
Then the bulk operation has failed for "Alice"
And "alice@example.com" should receive no emails

Expand All @@ -154,7 +158,8 @@ Feature: Buyer accounts bulk operations
When item "Alice" is selected
And select bulk action "Change account plan"
And select "Awesome" from "Plan"
And press "Change plan" and confirm the dialog
And press "Change plan"
And confirm the dialog
Then the bulk operation has failed for "Alice"

Scenario: Changing state throws an error
Expand All @@ -163,7 +168,8 @@ Feature: Buyer accounts bulk operations
And item "Pending buyer" is selected
And select bulk action "Change state"
When select "Approve" from "Action"
And press "Change state" and confirm the dialog within the modal
And press "Change state" within the modal
And confirm the dialog
Then the bulk operation has failed for "Pending buyer"

Scenario: Rejecting buyer accounts in bulk
Expand All @@ -180,7 +186,8 @@ Feature: Buyer accounts bulk operations
And item "Alice" is selected
And select bulk action "Change state"
And select "Reject" from "Action"
And press "Change state" and confirm the dialog within the modal
And press "Change state" within the modal
And confirm the dialog
Then should see "Successfully changed the state of 4 accounts"
And the table should contain the following:
| Group/Org. | State |
Expand Down
3 changes: 2 additions & 1 deletion features/buyers/accounts/edit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Feature: Audience > Accounts > Edit
Scenario: Deleting an account
Given a buyer "Deleteme" of the provider
When they go to the buyer account edit page for "Deleteme"
And follow "Delete" and confirm the dialog
And follow "Delete"
And confirm the dialog
Then the current page is the buyer accounts page
And they should see the flash message "The account was successfully deleted."
And should see the following table:
Expand Down
10 changes: 5 additions & 5 deletions features/buyers/accounts/index.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ Feature: Audience > Accounts
When they go to the buyer accounts page
Then the table does not have a column "Plan"

Scenario: Provider has multiple applications disabled
Scenario: Provider has "multiple_applications" denied
Given a buyer "Pepe" of the provider
And the default product of the provider has name "The API"
And the following application plan:
| Product | Name | Default |
| The API | Free | true |
And the provider has multiple applications disabled
And the provider has "multiple_applications" denied
When they go to the buyer accounts page
Then the table don't have a column "Apps"

Scenario: Provider has multiple applications enabled
Scenario: Provider has "multiple_applications" visible
Given a buyer "Pepe" of the provider
And the default product of the provider has name "The API"
And the following application plan:
| Product | Name | Default |
| The API | Free | true |
And the provider has multiple applications enabled
And the provider has "multiple_applications" visible
When they go to the buyer accounts page
Then should see following table:
| Group/Org. | Apps |
Expand Down Expand Up @@ -242,7 +242,7 @@ Feature: Audience > Accounts
@security
Scenario: Buyers from other providers are not listed
Given a provider "bar.3scale.localhost"
And provider "bar.3scale.localhost" has multiple applications enabled
And provider "bar.3scale.localhost" has "multiple_applications" visible
And a buyer "claire" signed up to provider "bar.3scale.localhost"
When they go to the buyer accounts page
Then they should not see "claire" in the buyer accounts table
Expand Down
18 changes: 12 additions & 6 deletions features/buyers/service_contracts/bulk_operations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ Feature: Audience > Accounts > Service subscriptions bulk operations
And select bulk action "Send email"
And fill in "Subject" with "This is the subject"
And fill in "Body" with "This is the body"
And press "Send" and confirm the dialog
And press "Send"
And confirm the dialog
Then I should see "Successfully sent 2 emails."
Then "jane@example.com" should receive 1 email
Then "bob@example.com" should receive 1 email
Expand All @@ -82,7 +83,8 @@ Feature: Audience > Accounts > Service subscriptions bulk operations
And item "Bob" is selected
And select bulk action "Change service plan"
And select "Fancy Plan B" from "Plan"
And press "Change plan" and confirm the dialog
And press "Change plan"
And confirm the dialog
Then should see "Successfully changed the plan of 2 subscriptions"
And the table should contain the following:
| Account | Service | Plan |
Expand All @@ -109,7 +111,8 @@ Feature: Audience > Accounts > Service subscriptions bulk operations
And item "Jane" is selected
And select bulk action "Change state"
And select "Suspend" from "Action"
And press "Change state" and confirm the dialog within the modal
And press "Change state" within the modal
And confirm the dialog
Then should see "Successfully changed the state of 2 subscriptions"
And the table should contain the following:
| Account | Service | State |
Expand All @@ -124,7 +127,8 @@ Feature: Audience > Accounts > Service subscriptions bulk operations
And select bulk action "Send email"
And fill in "Subject" with "Error"
And fill in "Body" with "This will fail"
And press "Send" and confirm the dialog
And press "Send"
And confirm the dialog
Then the bulk operation has failed for "Jane"
And "jane@example.com" should receive no emails

Expand All @@ -133,7 +137,8 @@ Feature: Audience > Accounts > Service subscriptions bulk operations
When item "Jane" is selected
And select bulk action "Change state"
When select "Suspend" from "Action"
And press "Change state" and confirm the dialog within the modal
And press "Change state" within the modal
And confirm the dialog
Then the bulk operation has failed for "Subscription of Jane to service Another API"
And the table should contain the following:
| Account | Service | State |
Expand All @@ -148,7 +153,8 @@ Feature: Audience > Accounts > Service subscriptions bulk operations
And item "Alice" is selected
And select bulk action "Change service plan"
And select "Fancy Plan B" from "Plan"
And press "Change plan" and confirm the dialog
And press "Change plan"
And confirm the dialog
Then the bulk operation has failed for "Subscription of Alice to service Fancy API"
And the table should contain the following:
| Account | Service | Plan |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Developer portal application credentials

Background:
Given a provider
And the provider has multiple applications enabled
And the provider has "multiple_applications" visible
And a product "My API"
And the following application plan:
| Product | Name |
Expand Down
2 changes: 1 addition & 1 deletion features/developer_portal/authentication/sso_token.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Feature: SSO Token

Background:
Given a provider "foo.3scale.localhost"
And provider "foo.3scale.localhost" has multiple applications enabled
And provider "foo.3scale.localhost" has "multiple_applications" visible
And a buyer "bob" signed up to provider "foo.3scale.localhost"
And the current domain is foo.3scale.localhost

Expand Down
2 changes: 1 addition & 1 deletion features/developer_portal/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Feature: Login feature

Background:
Given a provider "foo.3scale.localhost"
And provider "foo.3scale.localhost" has multiple applications enabled
And provider "foo.3scale.localhost" has "multiple_applications" visible
And a buyer "bob" signed up to provider "foo.3scale.localhost"

Scenario: Buyer lands on the homepage when in enterprise mode
Expand Down
4 changes: 2 additions & 2 deletions features/developer_portal/payment_details.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: Developer portal payment details

Scenario: Paid plan with prepaid billing
Given the date is 1st January 2023
Given the provider has multiple applications disabled
Given the provider has "multiple_applications" denied
And the provider is charging its buyers in prepaid mode
And plan "Pro" has a monthly fee of 200
And they go to the dev portal API access details page
Expand All @@ -29,7 +29,7 @@ Feature: Developer portal payment details

Scenario: Paid plan with postpaid billing
Given the date is 1st January 2023
Given the provider has multiple applications disabled
Given the provider has "multiple_applications" denied
And the provider is charging its buyers in postpaid mode
And plan "Pro" has a monthly fee of 200
And they go to the dev portal API access details page
Expand Down
6 changes: 4 additions & 2 deletions features/master/applications/keys.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ Feature: Application Keys management
@ignore-backend
Scenario: Regenerate provider key
Given they are reviewing the provider's application details
When follow "Regenerate" and confirm the dialog
When follow "Regenerate"
And confirm the dialog
And fill in "Current password" with "supersecret"
And press "Confirm Password"
And should see "You are now in super-user mode! Retry the action, please."
And follow "Regenerate" and confirm the dialog
And follow "Regenerate"
And confirm the dialog
Then should see "The key was successfully changed"

Scenario: Set a custom app key
Expand Down
Loading

0 comments on commit f0e20bc

Please sign in to comment.