Skip to content

Commit

Permalink
🥒 Fix "should see the following details" errors (#3849)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvillen authored Jul 23, 2024
1 parent 59fdfcc commit 2f7feba
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 30 deletions.
16 changes: 9 additions & 7 deletions features/developer_portal/admin/applications/credentials.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Feature: Developer portal application credentials
| My API | Free |
And a buyer "Jane"
And the following application:
| Buyer | Name | Product |
| Jane | Jane's App | My API |
| Buyer | Name | Product | Application Id | User key |
| Jane | Jane's App | My API | jane123 | qwerty-12345-banana123 |
And the buyer logs in

Scenario: Regenerate user key
Expand Down Expand Up @@ -51,23 +51,25 @@ Feature: Developer portal application credentials
Given the product uses backend v1

Scenario: Backend v1 uses a single user key
Given the application has user key "qwerty-12345-banana"
When they go to the dev portal API access details page
Then they should see the following details:
| Name | Jane's App |
| User key | qwerty-12345-banana |
| User Key | qwerty-12345-banana |
But there should not be a button to "Create new key"

Rule: Oauth
Background:
Given the product uses backend oauth
And the application has 3 keys
And the application has the following keys:
| key-one |
| key-two |
| key-three |

Scenario: Oauth uses client secret and ID
When they go to the dev portal API access details page
Then they should see the following details:
| Client ID | 123 |
| Client Secret | app-key |
| Client ID | jane123 |
| Client Secret | key-one |
| Redirect URL | This is your Redirect URL for OAuth |
And there should be a button to "Regenerate"

Expand Down
4 changes: 2 additions & 2 deletions features/developer_portal/admin/applications/edit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ Feature: Developer portal edit application page
And there is a field "Phone number"
And the form is submitted with:
| Phone number | 999-888-777 |
Then they should see the following details:
| Email | |
Then they should see the following details:
| Phone number | 999-888-777 |
| UUID | 123 |
| Secret sauce | Ketchup |
And should not see "Secret sauce"
4 changes: 2 additions & 2 deletions features/developer_portal/admin/applications/new.feature
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Feature: Developer portal new application page
| Name | My App |
| Description | Awesome ultimate super widget |
| Plan | Gold |
| Status | live |
| Status | Live |

Scenario: Can't choose application plan on app creating
Given the product has no default application plan
Expand All @@ -99,7 +99,7 @@ Feature: Developer portal new application page
| Name | MegaWidget |
| Description | Bla bla bla |
Then they should see the following details:
| Status | pending |
| Status | Pending |
And they should see "Your application is awaiting approval"

Scenario: Create an application with extra fields
Expand Down
22 changes: 13 additions & 9 deletions features/developer_portal/cms_toolbar.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ Feature: CMS Toolbar
And go to the homepage
Then there should not be a CMS toolbar

Scenario: An admin visist de dev portal
When they visit the developer portal in CMS mode
Then the cms toolbar should be visible
And should see "Templates used on this page"
And should see the following details:
| Username | john |
| Password | 123456 |
And should see "Color Theme"

Scenario: Hide the toolbar
When they visit the developer portal in CMS mode
And follow "Draft"
Expand All @@ -41,3 +32,16 @@ Feature: CMS Toolbar
And follow "Published"
And follow "Close the CMS toolbar"
Then there should not be a CMS toolbar

Rule: There is a John Doe admin user
Background:
When the admin user is John Doe

Scenario: An admin visist de dev portal
When they visit the developer portal in CMS mode
Then the cms toolbar should be visible
And should see "Templates used on this page"
And should see the following details:
| Username | john |
| Password | 123456 |
And should see "Color Theme"
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,9 @@ Feature: Application details card
And the application has the following extra fields:
| Recovery email | This is a required field |
| Verification code | |
| hidde_field | Hidden content |
| Hidden field | Hidden content |
When they go to the application's admin page
Then they should see the following details within the application details:
| Recovery email | This is a required field |
| User extra hidden | Hidden content |
Then they should see the following details within the application details:
| Recovery email | This is a required field |
| User extra hidden | Hidden content |
| Recovery email | This is a required field |
| Hidden field | Hidden content |
But should not see "User extra read only" within the application details
4 changes: 4 additions & 0 deletions features/step_definitions/account_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@
When "the account will return an error when changing its plan" do
Contract.any_instance.stubs(:change_plan).returns(false).once
end

When "the admin user is John Doe" do
Account.any_instance.expects(:john_doe_still_here?).returns(true)
end
4 changes: 0 additions & 4 deletions features/step_definitions/applications_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@
fake_application_keys(application, [key])
end

Given "{application} has user key {string}" do |application, key|
application.update!(user_key: key)
end

Then "there are/is {int} key(s)" do |keys|
assert_equal keys, find_all('tr.key').size
end
Expand Down

0 comments on commit 2f7feba

Please sign in to comment.