-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
195 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,39 @@ | ||
name: Test multi-project | ||
|
||
env: | ||
MOMENTIC_API_KEY: ${{ secrets.MOMENTIC_API_KEY }} | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
run-tests: | ||
name: Run all project tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
repository-projects: read | ||
defaults: | ||
run: | ||
working-directory: ./multi-project-workspace-example | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 21 | ||
cache: "pnpm" | ||
- name: Install dependencies | ||
run: pnpm i | ||
- name: Run specific marketing tests using project name and substring match | ||
run: npx momentic@^1 run --filter marketing variable | ||
env: | ||
VAR_FROM_SHELL: test-var-from-shell | ||
- name: Run all QA tests using config path | ||
run: npx momentic@^1 run --config qa/momentic.config.yaml . | ||
- name: Run dashboard tests using absolute path | ||
run: | | ||
cd apps/dashboard | ||
npx momentic@^1 run google-search.test.yaml |
This file contains 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
24 changes: 24 additions & 0 deletions
24
multi-project-workspace-example/apps/dashboard/google-search.test.yaml
This file contains 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,24 @@ | ||
fileType: momentic/test | ||
id: cfa6eb04-a97e-42c0-aeaa-5de0bc3cac0d | ||
name: google-search | ||
baseUrl: https://google.com | ||
schemaVersion: 1.0.18 | ||
advanced: | ||
disableAICaching: false | ||
viewport: | ||
width: 1920 | ||
height: 1080 | ||
browserType: Chromium | ||
retries: 0 | ||
steps: | ||
- id: 980f048a-7ab1-4b8f-b55d-0a0f7b195283 | ||
type: PRESET_ACTION | ||
command: | ||
id: e37b1fbc-bce3-4415-abd8-f5614db2b582 | ||
clearContent: true | ||
pressEnter: true | ||
type: TYPE | ||
target: | ||
type: description | ||
elementDescriptor: search bar | ||
value: hello world |
5 changes: 5 additions & 0 deletions
5
multi-project-workspace-example/apps/dashboard/momentic.config.yaml
This file contains 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,5 @@ | ||
name: dashboard | ||
include: | ||
- "**/*.test.yaml" | ||
- "**/*.module.yaml" | ||
- "../../common/**/*.module.yaml" |
11 changes: 11 additions & 0 deletions
11
multi-project-workspace-example/apps/marketing/momentic.config.yaml
This file contains 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,11 @@ | ||
name: marketing | ||
include: | ||
- "**/*.test.yaml" | ||
- "**/*.module.yaml" | ||
- "../../common/**/*.module.yaml" | ||
environments: | ||
- name: test | ||
baseUrl: https://google.com | ||
envFile: ../../test.env | ||
envVariables: | ||
VAR_FROM_SHELL: ${VAR_FROM_SHELL} |
29 changes: 29 additions & 0 deletions
29
multi-project-workspace-example/apps/marketing/variable-showcase.test.yaml
This file contains 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,29 @@ | ||
fileType: momentic/test | ||
id: 345ced8b-ba15-4681-9fab-ba5e8296aa28 | ||
name: variable-showcase | ||
schemaVersion: 1.0.18 | ||
advanced: | ||
disableAICaching: false | ||
viewport: | ||
width: 1920 | ||
height: 1080 | ||
retries: 0 | ||
envs: | ||
- name: test | ||
default: true | ||
steps: | ||
- id: 1ab5e9b2-eb86-4b05-a20e-a47338d9ceeb | ||
type: PRESET_ACTION | ||
command: | ||
id: f2e39d7f-db4a-4ce4-9cc9-22988c9cb83e | ||
code: |- | ||
assert(env.VAR_FROM_FILE === "test-var-from-file") | ||
assert(env.INTERPOLATED_VAR_FROM_FILE === "test-var-from-file-default") | ||
type: JAVASCRIPT | ||
- id: b8f38734-b3ab-45a7-bbd1-bc790fee8cf5 | ||
type: PRESET_ACTION | ||
command: | ||
id: 4b905660-e1d0-4209-b09c-f9d08598a167 | ||
code: | | ||
assert(env.VAR_FROM_SHELL === "test-var-from-shell") | ||
type: JAVASCRIPT |
33 changes: 33 additions & 0 deletions
33
multi-project-workspace-example/common/practice-test-login.module.yaml
This file contains 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,33 @@ | ||
fileType: momentic/module | ||
schemaVersion: 1.0.18 | ||
moduleId: a0575e3f-bba8-48a3-91f6-1fb77de5188b | ||
name: practice-test-login | ||
description: "" | ||
enabled: true | ||
steps: | ||
- id: 4657574e-caab-4c1e-9f50-2dfa4a4b4927 | ||
type: PRESET_ACTION | ||
command: | ||
id: 4f0c99f5-743d-4e21-b642-0d2772d32941 | ||
clearContent: true | ||
type: TYPE | ||
target: | ||
type: description | ||
elementDescriptor: username textbox | ||
value: student | ||
- id: 42056ded-31aa-458e-82ec-c3a981172e6f | ||
type: PRESET_ACTION | ||
command: | ||
id: 4b56e24d-d471-4123-8bb6-5ab1d04ad06e | ||
clearContent: true | ||
type: TYPE | ||
target: | ||
type: description | ||
elementDescriptor: password textbox | ||
value: Password123 | ||
- id: d78e2d9c-9dff-4363-a9da-bc2222240258 | ||
type: PRESET_ACTION | ||
command: | ||
id: da49a90d-d83d-460c-99c1-ae0005ff80c8 | ||
type: PRESS | ||
value: Enter |
This file contains 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,5 @@ | ||
projects: | ||
- qa | ||
# immediate children directories of apps | ||
- apps/* | ||
|
This file contains 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,6 @@ | ||
name: qa | ||
include: | ||
- "**/*.test.yaml" | ||
- "**/*.module.yaml" | ||
- ../common/**/*.module.yaml" | ||
moduleCreationDir: ../common |
39 changes: 39 additions & 0 deletions
39
multi-project-workspace-example/qa/practice-test-login.test.yaml
This file contains 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,39 @@ | ||
fileType: momentic/test | ||
id: 032132e8-0271-44d3-a439-5165d6c5e182 | ||
name: practice-test-login | ||
baseUrl: https://practicetestautomation.com/practice-test-login/ | ||
schemaVersion: 1.0.18 | ||
advanced: | ||
disableAICaching: false | ||
viewport: | ||
width: 1920 | ||
height: 1080 | ||
browserType: Chromium | ||
retries: 0 | ||
steps: | ||
- id: 4657574e-caab-4c1e-9f50-2dfa4a4b4927 | ||
type: PRESET_ACTION | ||
command: | ||
id: 4f0c99f5-743d-4e21-b642-0d2772d32941 | ||
clearContent: true | ||
type: TYPE | ||
target: | ||
type: description | ||
elementDescriptor: username textbox | ||
value: student | ||
- id: 42056ded-31aa-458e-82ec-c3a981172e6f | ||
type: PRESET_ACTION | ||
command: | ||
id: 4b56e24d-d471-4123-8bb6-5ab1d04ad06e | ||
clearContent: true | ||
type: TYPE | ||
target: | ||
type: description | ||
elementDescriptor: password textbox | ||
value: Password123 | ||
- id: d78e2d9c-9dff-4363-a9da-bc2222240258 | ||
type: PRESET_ACTION | ||
command: | ||
id: da49a90d-d83d-460c-99c1-ae0005ff80c8 | ||
type: PRESS | ||
value: Enter |
This file contains 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,2 @@ | ||
VAR_FROM_FILE=test-var-from-file | ||
INTERPOLATED_VAR_FROM_FILE=${NON_EXISTENT:-test-var-from-file-default} |