Skip to content

Commit

Permalink
Run Behat tests on Github Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Feb 20, 2024
1 parent 24d7a54 commit 2013d82
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/stepup-behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: stepup-behat
on:
pull_request:
push:
branches: [ main, feature/*, bugfix/* ]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
DOCKER_COMPOSE: docker compose -f docker-compose.yml -f docker-compose-behat.yml
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Init environment
run: |
cd stepup
cp .env.test .env
cp gateway/surfnet_yubikey.yaml.dist gateway/surfnet_yubikey.yaml
${DOCKER_COMPOSE} up -d
- name: Install composer dependencies on the Behat container
run: |
cd stepup
${DOCKER_COMPOSE} exec -T behat bash -lc "composer install --ignore-platform-reqs -n"
- name: Sleep for 10 seconds
run: sleep 10s
- name: Run Behat tests
run: |
cd stepup
docker exec -t stepup-behat-1 bash -lc "./behat"
- name: Output logs on failure
if: failure()
run: |
cd stepup
${DOCKER_COMPOSE} logs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ public function iCanAddAnRecoveryToken(string $recoveryTokenType, string $tokenT
$form->submit();
$this->provePossession($tokenType);
// Now you need to register your SMS recovery token
$this->diePrintingContent();
$this->minkContext->assertPageContainsText('Register an SMS recovery token');
$this->minkContext->fillField('ss_send_sms_challenge_subscriber', '615056898');
$this->minkContext->pressButton('Send code');
Expand Down
1 change: 1 addition & 0 deletions stepup/tests/behat/features/selfservice_sat.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Feature: A user manages his tokens in the SelfService portal
And I vet my "Demo GSSP" second factor in selfservice
And "1" recovery tokens are activated

@SKIP
Scenario: A user can register an additional recovery token
Given I am logged in into the selfservice portal as "user-a4"
When I register a new "Yubikey" token
Expand Down

0 comments on commit 2013d82

Please sign in to comment.