From 2f7feba0e5defec840a08b56bc763690feae2d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Vill=C3=A9n?= <72191439+lvillen@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:47:06 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=92=20Fix=20"should=20see=20the=20foll?= =?UTF-8?q?owing=20details"=20errors=20(#3849)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/applications/credentials.feature | 16 ++++++++------ .../admin/applications/edit.feature | 4 ++-- .../admin/applications/new.feature | 4 ++-- features/developer_portal/cms_toolbar.feature | 22 +++++++++++-------- .../show/application_details.feature | 9 +++----- features/step_definitions/account_steps.rb | 4 ++++ .../step_definitions/applications_steps.rb | 4 ---- 7 files changed, 33 insertions(+), 30 deletions(-) diff --git a/features/developer_portal/admin/applications/credentials.feature b/features/developer_portal/admin/applications/credentials.feature index ddc376cdcc..42bd18bdf0 100644 --- a/features/developer_portal/admin/applications/credentials.feature +++ b/features/developer_portal/admin/applications/credentials.feature @@ -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 @@ -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" diff --git a/features/developer_portal/admin/applications/edit.feature b/features/developer_portal/admin/applications/edit.feature index a48dd655c5..ee6e1ab483 100644 --- a/features/developer_portal/admin/applications/edit.feature +++ b/features/developer_portal/admin/applications/edit.feature @@ -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" diff --git a/features/developer_portal/admin/applications/new.feature b/features/developer_portal/admin/applications/new.feature index fce9fd60d7..26876e67d3 100644 --- a/features/developer_portal/admin/applications/new.feature +++ b/features/developer_portal/admin/applications/new.feature @@ -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 @@ -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 diff --git a/features/developer_portal/cms_toolbar.feature b/features/developer_portal/cms_toolbar.feature index f1aee093ae..e016178b20 100644 --- a/features/developer_portal/cms_toolbar.feature +++ b/features/developer_portal/cms_toolbar.feature @@ -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" @@ -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" diff --git a/features/provider/admin/applications/show/application_details.feature b/features/provider/admin/applications/show/application_details.feature index 8e2a77f10a..0a324e2478 100644 --- a/features/provider/admin/applications/show/application_details.feature +++ b/features/provider/admin/applications/show/application_details.feature @@ -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 diff --git a/features/step_definitions/account_steps.rb b/features/step_definitions/account_steps.rb index 4ccbfe4bf2..53c9716375 100644 --- a/features/step_definitions/account_steps.rb +++ b/features/step_definitions/account_steps.rb @@ -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 diff --git a/features/step_definitions/applications_steps.rb b/features/step_definitions/applications_steps.rb index e77a45e614..6b9e155548 100644 --- a/features/step_definitions/applications_steps.rb +++ b/features/step_definitions/applications_steps.rb @@ -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