Skip to content

Commit 35cd4eb

Browse files
committed
Initial commit
0 parents  commit 35cd4eb

File tree

311 files changed

+184272
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

311 files changed

+184272
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.bitrise.secrets.yml
2+
main

Gopkg.lock

+155
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Gopkg.toml example
2+
#
3+
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4+
# for detailed Gopkg.toml documentation.
5+
#
6+
# required = ["github.com/user/thing/cmd/thing"]
7+
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8+
#
9+
# [[constraint]]
10+
# name = "github.com/user/project"
11+
# version = "1.0.0"
12+
#
13+
# [[constraint]]
14+
# name = "github.com/user/project2"
15+
# branch = "dev"
16+
# source = "github.com/myfork/project2"
17+
#
18+
# [[override]]
19+
# name = "github.com/x/y"
20+
# version = "2.4.0"
21+
#
22+
# [prune]
23+
# non-go = false
24+
# go-tests = true
25+
# unused-packages = true
26+
27+
[[constraint]]
28+
branch = "master"
29+
name = "github.com/bitrise-tools/go-steputils"
30+
31+
[[constraint]]
32+
branch = "master"
33+
name = "github.com/bitrise-io/go-utils"
34+
35+
[prune]
36+
go-tests = true
37+
unused-packages = true

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 TRIDENT Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# magicpod-uitest
2+
3+
Magic Pod UI test step
4+
5+
6+
## How to use this Step
7+
8+
Can be run directly with the [bitrise CLI](https://github.com/bitrise-io/bitrise),
9+
just `git clone` this repository, `cd` into it's folder in your Terminal/Command Line
10+
and call `bitrise run test`.
11+
12+
*Check the `bitrise.yml` file for required inputs which have to be
13+
added to your `.bitrise.secrets.yml` file!*
14+
15+
Requirements:
16+
17+
- You need to sign up to `https://magic-pod.com` and create test cases first.
18+
- You also need to confirm your API token in `https://magic-pod.com/accounts/api-token/`
19+
20+
Step by step:
21+
22+
1. Open up your Terminal / Command Line
23+
2. `git clone` the repository
24+
3. `cd` into the directory of the step (the one you just `git clone`d)
25+
5. Create a `.bitrise.secrets.yml` file in the same directory of `bitrise.yml`
26+
(the `.bitrise.secrets.yml` is a git ignored file, you can store your secrets in it)
27+
6. Check the `bitrise.yml` file for any secret you should set in `.bitrise.secrets.yml`
28+
* Best practice is to mark these options with something like `# define these in your .bitrise.secrets.yml`, in the `app:envs` section.
29+
7. Once you have all the required secret parameters in your `.bitrise.secrets.yml` you can just run this step with the [bitrise CLI](https://github.com/bitrise-io/bitrise): `bitrise run test`
30+
31+
An example `.bitrise.secrets.yml` file:
32+
33+
```
34+
envs:
35+
- MAGIC_POD_API_TOKEN: "<YOUR_TOKEN>"
36+
- BITRISE_APP_DIR_PATH: "<PATH_TO_YOUR_APP_FILE>"
37+
- BASE_URL: "https://magic-pod.com/api/v1.0"
38+
```

bitrise.yml

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
format_version: 4
2+
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
3+
4+
app:
5+
envs:
6+
# define these in your .bitrise.secrets.yml
7+
- MAGIC_POD_API_TOKEN: "2539e94a60e7822452bcc6cce3f10de696b022d5"
8+
- ORGANIZATION_NAME: $ORGANIZATION_NAME
9+
- PROJECT_NAME: $PROJECT_NAME
10+
- TEST_CONDITION_NUMBER: $TEST_CONDITION_NUMBER
11+
- APP_PATH: $APP_PATH
12+
- WAIT_FOR_RESULT: $WAIT_FOR_RESULT
13+
- DELETE_APP_AFTER_TEST: $DELETE_APP_AFTER_TEST
14+
- BASE_URL: $BASE_URL
15+
# If you want to share this step into a StepLib
16+
- BITRISE_STEP_ID: magicpod-uitest
17+
- BITRISE_STEP_VERSION: "0.1.0"
18+
- BITRISE_STEP_GIT_CLONE_URL: https://github.com/magic-Pod/bitrise-step-magicpod-uitest.git
19+
- MY_STEPLIB_REPO_FORK_GIT_URL: $MY_STEPLIB_REPO_FORK_GIT_URL
20+
21+
workflows:
22+
test:
23+
steps:
24+
# - go-list:
25+
# - golint:
26+
- secure-delete-path:
27+
inputs:
28+
- path: ./_tmp
29+
- with_sudo: "false"
30+
- change-workdir:
31+
title: Switch working dir to test / _tmp dir
32+
description: |-
33+
To prevent step testing issues, like referencing relative
34+
files with just './some-file' in the step's code, which would
35+
work for testing the step from this directory directly
36+
but would break if the step is included in another `bitrise.yml`.
37+
run_if: true
38+
inputs:
39+
- path: ./_tmp
40+
- is_create_path: true
41+
- path::./:
42+
title: Step Test
43+
run_if: true
44+
inputs:
45+
- magic_pod_api_token: $MAGIC_POD_API_TOKEN
46+
- organization_name: $ORGANIZATION_NAME
47+
- project_name: $PROJECT_NAME
48+
- test_condition_number: $TEST_CONDITION_NUMBER
49+
- app_path: $APP_PATH
50+
- wait_for_result: $WAIT_FOR_RESULT
51+
- delete_app_after_test: $DELETE_APP_AFTER_TEST
52+
- base_url: $BASE_URL
53+
- script:
54+
inputs:
55+
- content: |
56+
#!/bin/bash
57+
echo "This output was generated by the Step (MAGIC_POD_TEST_STATUS): $MAGIC_POD_TEST_STATUS"
58+
echo "This output was generated by the Step (MAGIC_POD_TEST_SUCCEEDED_COUNT): $MAGIC_POD_TEST_SUCCEEDED_COUNT"
59+
echo "This output was generated by the Step (MAGIC_POD_TEST_FAILED_COUNT): $MAGIC_POD_TEST_FAILED_COUNT"
60+
echo "This output was generated by the Step (MAGIC_POD_TEST_FAILED_COUNT): $MAGIC_POD_TEST_UNRESOLVED_COUNT"
61+
echo "This output was generated by the Step (MAGIC_POD_TEST_TOTAL_COUNT): $MAGIC_POD_TEST_TOTAL_COUNT"
62+
echo "This output was generated by the Step (MAGIC_POD_TEST_URL): $MAGIC_POD_TEST_URL"
63+
64+
65+
# ----------------------------------------------------------------
66+
# --- workflows to Share this step into a Step Library
67+
audit-this-step:
68+
steps:
69+
- script:
70+
inputs:
71+
- content: |-
72+
#!/bin/bash
73+
set -ex
74+
stepman audit --step-yml ./step.yml
75+
76+
share-this-step:
77+
envs:
78+
# if you want to share this step into a StepLib
79+
- MY_STEPLIB_REPO_FORK_GIT_URL: $MY_STEPLIB_REPO_FORK_GIT_URL
80+
- BITRISE_STEP_ID: $BITRISE_STEP_ID
81+
- BITRISE_STEP_VERSION: $BITRISE_STEP_VERSION
82+
- BITRISE_STEP_GIT_CLONE_URL: $BITRISE_STEP_GIT_CLONE_URL
83+
description: |-
84+
If this is the first time you try to share a Step you should
85+
first call: $ bitrise share
86+
87+
This will print you a guide, and information about how Step sharing
88+
works. Please read it at least once!
89+
90+
As noted in the Step sharing guide you'll have to fork the
91+
StepLib you want to share this step into. Once you're done with forking
92+
the repository you should set your own fork's git clone URL
93+
in the `.bitrise.secrets.yml` file, or here in the `envs` section,
94+
as the value of the `MY_STEPLIB_REPO_FORK_GIT_URL` environment.
95+
96+
You're now ready to share this Step, just make sure that
97+
the `BITRISE_STEP_ID` and `BITRISE_STEP_VERSION`
98+
environments are set to the desired values!
99+
100+
To share this Step into a StepLib you can just run: $ bitrise run share-this-step
101+
102+
Once it finishes the only thing left is to actually create a Pull Request,
103+
the way described in the guide printed at the end of the process.
104+
before_run:
105+
- audit-this-step
106+
steps:
107+
- script:
108+
inputs:
109+
- content: |-
110+
#!/bin/bash
111+
set -ex
112+
bitrise share start -c "${MY_STEPLIB_REPO_FORK_GIT_URL}"
113+
bitrise share create --stepid "${BITRISE_STEP_ID}" --tag "${BITRISE_STEP_VERSION}" --git "${BITRISE_STEP_GIT_CLONE_URL}"
114+
bitrise share finish

0 commit comments

Comments
 (0)