-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add gherkin container flavor #846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e7035f1
feat: add gherkin container flavor
rjaegers 60df592
chore: fix linter violation
rjaegers 500da9b
chore: install gplint
rjaegers 0e2bfa8
Merge branch 'main' into feature/add-gherkin-flavor
rjaegers 8f94124
chore: fix gherkin build
rjaegers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "image": "ghcr.io/philips-software/amp-devcontainer-gherkin:${localEnv:IMAGE_VERSION}", | ||
| "workspaceFolder": "/workspaces/amp-devcontainer/test/gherkin/workspace" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| FROM ubuntu:24.04@sha256:b59d21599a2b151e23eea5f6602f4af4d7d31c4e236d22bf0b62b86d2e386b8f | ||
|
|
||
| ARG BATS_VERSION=1.11.0 | ||
| ARG NODE_MAJOR=20 | ||
|
|
||
| ARG DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| HEALTHCHECK NONE | ||
|
|
||
| SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
|
||
| # Install the base system with all tool dependencies | ||
| # hadolint ignore=DL3008 | ||
| RUN --mount=type=bind,source=.devcontainer/gherkin/apt-requirements-base.json,target=/tmp/apt-requirements-base.json \ | ||
| --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
| --mount=type=cache,target=/var/lib/apt,sharing=locked \ | ||
| --mount=type=cache,target=/var/log,sharing=locked \ | ||
| apt-get update && apt-get install -y --no-install-recommends jq \ | ||
| && jq -r 'to_entries | .[] | .key + "=" + .value' /tmp/apt-requirements-base.json | \ | ||
| xargs apt-get install -y --no-install-recommends \ | ||
| # Include the Cisco Umbrella PKI Root | ||
| && wget -qO /usr/local/share/ca-certificates/Cisco_Umbrella_Root_CA.crt https://www.cisco.com/security/pki/certs/ciscoumbrellaroot.pem \ | ||
| && update-ca-certificates \ | ||
| && wget -qO - https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource-keyring.gpg \ | ||
| && echo "deb [signed-by=/usr/share/keyrings/nodesource-keyring.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null \ | ||
| && apt-get update && apt-get install -y --no-install-recommends nodejs \ | ||
| && npm install -g [email protected] \ | ||
| && cp /etc/skel/.bashrc /root/.bashrc | ||
|
|
||
| # Install bats | ||
| RUN batstmp="$(mktemp -d /tmp/bats-core-${BATS_VERSION}.XXXX)" \ | ||
| && wget -qO - "https://github.com/bats-core/bats-core/archive/refs/tags/v${BATS_VERSION}.tar.gz" | tar xz -C "${batstmp}" \ | ||
| && bash "${batstmp}/bats-core-${BATS_VERSION}/install.sh" /usr/local \ | ||
| && rm -rf "${batstmp}" \ | ||
| && git -C /usr/local clone -b v0.3.0 https://github.com/bats-core/bats-support.git \ | ||
| && git -C /usr/local clone -b v2.1.0 https://github.com/bats-core/bats-assert.git | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "bash-completion": "1:2.11-8", | ||
| "ca-certificates": "20240203", | ||
| "git": "1:2.43.0-1ubuntu7.2", | ||
| "gnupg2": "2.4.4-2ubuntu17.2", | ||
| "wget": "1.21.4-1ubuntu4.1" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "remoteEnv": { | ||
| "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "[email protected]", | ||
| "[email protected]", | ||
| "[email protected]" | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "context": "../.." | ||
| }, | ||
| "remoteEnv": { | ||
| "CONTAINER_FLAVOR": "gherkin" | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "settings": { | ||
| "files.insertFinalNewline": true, | ||
| "files.trimTrailingWhitespace": true | ||
| }, | ||
| "extensions": [ | ||
| "[email protected]", | ||
| "[email protected]", | ||
| "[email protected]", | ||
| "[email protected]", | ||
| "[email protected]", | ||
| "[email protected]", | ||
| "[email protected]" | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/env bats | ||
|
|
||
| bats_require_minimum_version 1.5.0 | ||
|
|
||
| setup() { | ||
| load '/usr/local/bats-support/load' | ||
| load '/usr/local/bats-assert/load' | ||
|
|
||
| pushd ${BATS_TEST_DIRNAME}/workspace | ||
| } | ||
|
|
||
| teardown() { | ||
| popd | ||
| } | ||
|
|
||
| @test "gherkin tests should start" { | ||
| ls -la | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| Feature: Shopping Cart Functionality | ||
| As an online shopper | ||
| I want to manage items in my shopping cart | ||
| So that I can purchase the products I need | ||
|
|
||
| Background: | ||
| Given the online store is operational | ||
| And I am logged in as a registered user | ||
| And my shopping cart is empty | ||
|
|
||
| Rule: Users must be logged in to add items to cart | ||
| Example: Adding an item to cart as a logged-in user | ||
| When I browse to the "Electronics" category | ||
| And I select the "Smartphone" product | ||
| Then I should see the product details | ||
| And the "Add to Cart" button should be enabled | ||
| When I click the "Add to Cart" button | ||
| Then 1 item should be added to my cart | ||
| And I should see a confirmation message | ||
|
|
||
| Rule: Cart total must be calculated correctly | ||
| Scenario Outline: Verifying cart calculations with different quantities | ||
| Given I have added a "<product>" with price $<price> to my cart | ||
| When I update the quantity to <quantity> | ||
| Then the item subtotal should be $<subtotal> | ||
| And the cart total should include the subtotal | ||
|
|
||
| Examples: | ||
| | product | price | quantity | subtotal | | ||
| | Headphones | 50.00 | 2 | 100.00 | | ||
| | Charger | 25.00 | 3 | 75.00 | | ||
| | Case | 15.99 | 1 | 15.99 | | ||
|
|
||
| Rule: Users can adjust quantities of items in cart | ||
| Scenario: Increasing item quantity | ||
| Given I have added a "Tablet" with price $199.99 to my cart | ||
| When I increase the quantity to 2 | ||
| Then the cart should contain 2 "Tablet" items | ||
| And the item subtotal should be $399.98 | ||
|
|
||
| Scenario: Removing an item from the cart | ||
| Given I have added a "Laptop" with price $899.99 to my cart | ||
| When I click the "Remove" button for this item | ||
| Then the item should be removed from my cart | ||
| And my cart should be empty | ||
| But the item should be available for future purchase | ||
|
|
||
| Rule: Checkout process requires valid payment information | ||
| @critical @payment | ||
| Scenario: Proceeding to checkout with valid payment details | ||
| Given I have added a "Monitor" with price $249.99 to my cart | ||
| And I have proceeded to the checkout page | ||
| When I enter valid shipping information | ||
| And I enter valid payment details | ||
| | Card Type | Card Number | Expiry Date | CVV | | ||
| | Visa | 4111111111111111 | 12/25 | 123 | | ||
| And I confirm the order | ||
| Then I should see an order confirmation | ||
| And I should receive an email receipt | ||
| * My cart should be empty after purchase |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.