From 7af674c6f03f7db61de893eb762647928a90ad17 Mon Sep 17 00:00:00 2001 From: tomaszszopinski Date: Fri, 21 Jun 2024 08:52:21 +0200 Subject: [PATCH] [Behat] IBX-8416: Add basic behat feature to bundle generator --- skeleton/ibexa-ee/.github/workflows/browser-tests.yaml | 2 +- skeleton/ibexa-ee/{behat.yaml => behat_suites.yml} | 2 ++ skeleton/ibexa-ee/features/browser/.gitkeep | 0 skeleton/ibexa-ee/features/browser/BasicLogin.feature | 8 ++++++++ skeleton/ibexa-oss/.github/workflows/browser-tests.yaml | 2 +- skeleton/ibexa-oss/{behat.yaml => behat_suites.yml} | 2 ++ skeleton/ibexa-oss/features/browser/.gitkeep | 0 skeleton/ibexa-oss/features/browser/BasicLogin.feature | 8 ++++++++ 8 files changed, 22 insertions(+), 2 deletions(-) rename skeleton/ibexa-ee/{behat.yaml => behat_suites.yml} (55%) delete mode 100644 skeleton/ibexa-ee/features/browser/.gitkeep create mode 100644 skeleton/ibexa-ee/features/browser/BasicLogin.feature rename skeleton/ibexa-oss/{behat.yaml => behat_suites.yml} (62%) delete mode 100644 skeleton/ibexa-oss/features/browser/.gitkeep create mode 100644 skeleton/ibexa-oss/features/browser/BasicLogin.feature diff --git a/skeleton/ibexa-ee/.github/workflows/browser-tests.yaml b/skeleton/ibexa-ee/.github/workflows/browser-tests.yaml index 617c9f6..b2caa0c 100644 --- a/skeleton/ibexa-ee/.github/workflows/browser-tests.yaml +++ b/skeleton/ibexa-ee/.github/workflows/browser-tests.yaml @@ -13,7 +13,7 @@ jobs: uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main with: project-edition: 'commerce' - test-suite: '--profile=browser --suite=__PACKAGE_NAME__ --config=vendor/__VENDOR_NAME__/__PACKAGE_NAME__/behat.yaml' + test-suite: '--profile=browser --suite=__PACKAGE_NAME__ --config=vendor/__VENDOR_NAME__/__PACKAGE_NAME__/behat_suites.yaml' secrets: SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }} SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }} diff --git a/skeleton/ibexa-ee/behat.yaml b/skeleton/ibexa-ee/behat_suites.yml similarity index 55% rename from skeleton/ibexa-ee/behat.yaml rename to skeleton/ibexa-ee/behat_suites.yml index a2b6fee..0698134 100644 --- a/skeleton/ibexa-ee/behat.yaml +++ b/skeleton/ibexa-ee/behat_suites.yml @@ -5,3 +5,5 @@ browser: - '%paths.base%/features/browser' contexts: - Ibexa\Behat\API\Context\TestContext + - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext + - Ibexa\AdminUi\Behat\BrowserContext\AuthenticationContext \ No newline at end of file diff --git a/skeleton/ibexa-ee/features/browser/.gitkeep b/skeleton/ibexa-ee/features/browser/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/skeleton/ibexa-ee/features/browser/BasicLogin.feature b/skeleton/ibexa-ee/features/browser/BasicLogin.feature new file mode 100644 index 0000000..b1002d7 --- /dev/null +++ b/skeleton/ibexa-ee/features/browser/BasicLogin.feature @@ -0,0 +1,8 @@ +@IbexaHeadless @IbexaExperience @IbexaCommerce +Feature: An example test checking if user can login and if behat config is proper. + + @javascript + Scenario: User can log in as admin user + Given I open Login page in admin SiteAccess + When I log in as admin with password publish + Then I should be on Dashboard page \ No newline at end of file diff --git a/skeleton/ibexa-oss/.github/workflows/browser-tests.yaml b/skeleton/ibexa-oss/.github/workflows/browser-tests.yaml index b949785..b949884 100644 --- a/skeleton/ibexa-oss/.github/workflows/browser-tests.yaml +++ b/skeleton/ibexa-oss/.github/workflows/browser-tests.yaml @@ -13,6 +13,6 @@ jobs: uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main with: project-edition: 'oss' - test-suite: '--profile=browser --suite=__PACKAGE_NAME__ --config=vendor/__VENDOR_NAME__/__PACKAGE_NAME__/behat.yaml' + test-suite: '--profile=browser --suite=__PACKAGE_NAME__ --config=vendor/__VENDOR_NAME__/__PACKAGE_NAME__/behat_suites.yaml' secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/skeleton/ibexa-oss/behat.yaml b/skeleton/ibexa-oss/behat_suites.yml similarity index 62% rename from skeleton/ibexa-oss/behat.yaml rename to skeleton/ibexa-oss/behat_suites.yml index eb6a234..4f79f29 100644 --- a/skeleton/ibexa-oss/behat.yaml +++ b/skeleton/ibexa-oss/behat_suites.yml @@ -8,3 +8,5 @@ browser: - '%paths.base%/features/browser' contexts: - Ibexa\Behat\API\Context\TestContext + - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext + - Ibexa\AdminUi\Behat\BrowserContext\AuthenticationContext diff --git a/skeleton/ibexa-oss/features/browser/.gitkeep b/skeleton/ibexa-oss/features/browser/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/skeleton/ibexa-oss/features/browser/BasicLogin.feature b/skeleton/ibexa-oss/features/browser/BasicLogin.feature new file mode 100644 index 0000000..377778b --- /dev/null +++ b/skeleton/ibexa-oss/features/browser/BasicLogin.feature @@ -0,0 +1,8 @@ +@IbexaOSS +Feature: An example test checking if user can login and if behat config is proper. + + @javascript + Scenario: User can log in as admin user + Given I open Login page in admin SiteAccess + When I log in as admin with password publish + Then I should be on Dashboard page \ No newline at end of file