Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
827
Issues
827
List
Boards
Labels
Service Desk
Milestones
Merge Requests
44
Merge Requests
44
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
dd7cd082
Commit
dd7cd082
authored
2 hours ago
by
Ben Hayward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made executable in git and made it run from any dir
parent
02d0c2b7
No related merge requests found
Pipeline
#82538817
failed with stages
in 2 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
0 deletions
+106
-0
e2e.sh
cypress/e2e.sh
+106
-0
No files found.
cypress/e2e.sh
0 → 100755
View file @
dd7cd082
#!/usr/bin/env bash
# Boilerplate generated with create-bash-script (c) 2019 Nikita Skobov
# Available https://github.com/nikita-skobov/create-bash-script
function
usage
()
{
local
just_help
=
$1
local
missing_required
=
$2
local
invalid_argument
=
$3
local
invalid_option
=
$4
local help
=
"Usage: e2e.sh [OPTIONS]
Intended to serve as an interaction wrapper around Cypress.
Example: ./e2e.sh -u nemofin -p password123 -v true -url http://www.minds.com/
Options (* indicates it is required):"
local
help_options
=
"
*
\-
p ,
\-
-password
\<
Parameter>
\
The password of the user.
\-
url ,
\-
-url
\<
Parameter>
\
The URL of the host e.g. https://www.minds.com/ - defaults to use localhost.
\-
u ,
\-
-username
\<
Parameter>
\
The username - defaults to cypress_e2e_test.
\-
v ,
\-
--video
\<
Parameter>
\
true if you want video providing.
"
if
[
"
$missing_required
"
!=
""
]
then
echo
"Missing required argument:
$missing_required
"
fi
if
[
"
$invalid_option
"
!=
""
]
&&
[
"
$invalid_value
"
=
""
]
then
echo
"Invalid option:
$invalid_option
"
elif
[
"
$invalid_value
"
!=
""
]
then
echo
"Invalid value:
$invalid_value
for option: --
$invalid_option
"
fi
echo
-e
"
"
echo
"
$help
"
echo
"
$help_options
"
| column
-t
-s
'\'
return
}
function
init_args
()
{
REQ_ARGS
=(
"password"
)
# get command line arguments
POSITIONAL
=()
# set default arguments
url
=
"http://localhost"
username
=
"minds_cypress_tests"
_video
=
false
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
case
$key
in
-url
|
--url
)
url
=
"
$2
"
shift
2
;;
-u
|
--username
)
username
=
"
$2
"
shift
2
;;
-p
|
--password
)
password
=
"
$2
"
shift
2
;;
-v
|
---video
)
_video
=
"
$2
"
shift
2
;;
*
)
POSITIONAL+
=(
"
$1
"
)
# saves unknown option in array
shift
;;
esac
done
for
i
in
"
${
REQ_ARGS
[@]
}
"
;
do
# $i is the string of the variable name
# ${!i} is a parameter expression to get the value
# of the variable whose name is i.
req_var
=
${
!i
}
if
[
"
$req_var
"
=
""
]
then
usage
""
"--
$i
"
exit
fi
done
}
init_args
$@
# cd to project root
while
[[
$PWD
!=
'/'
&&
${
PWD
##*/
}
!=
'front'
]]
;
do
cd
..
;
done
# run cypress with args
./node_modules/cypress/bin/cypress open
--config
baseUrl
=
$url
,video
=
$_video
--env
username
=
$username
,password
=
$password
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment