Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automated_testing_kit
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
automated_testing_kit
Merge requests
!11
add afterAll(), fix some tests
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add afterAll(), fix some tests
IL/teardown
into
1.3.x
Overview
0
Commits
14
Pipelines
0
Changes
10
Merged
ilyaukin
requested to merge
IL/teardown
into
1.3.x
7 months ago
Overview
0
Commits
14
Pipelines
0
Changes
10
Expand
fix message check (check visibility)
fix false negative on email check
use different random user on each test
etc.
0
0
Merge request reports
Compare
1.3.x
version 5
b93896ea
6 months ago
version 4
0de07b96
7 months ago
version 3
b856648f
7 months ago
version 2
65fe366e
7 months ago
version 1
e69aaf91
7 months ago
1.3.x (base)
and
latest version
latest version
b96bdede
14 commits,
6 months ago
version 5
b93896ea
13 commits,
6 months ago
version 4
0de07b96
12 commits,
7 months ago
version 3
b856648f
10 commits,
7 months ago
version 2
65fe366e
9 commits,
7 months ago
version 1
e69aaf91
8 commits,
7 months ago
10 files
+
243
−
181
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
module_support/atk_setup
+
63
−
21
Options
#!/bin/bash
# Set up tests for specified testing framework.
# Can copy or link the tests to their destination.
# Set up either Cypress or Playwright tests.
# Can copy or link the tests to their destination as well as copy
# the tests back to their original location, which is useful
# for ATK contributors.
# Change WEB_ROOT_DIR as needed (usually "html" or "web").
# atk_setup <framework> <"back"|"link"|"">
# 1st argument:
# framework = "playwright" OR "cypress"
# 2nd argument:
# <blank> = copy tests
# "link" = symlink tests instead of copying them
# "back" = copy tests back to module
# For the initial install, from the project root
# (above web or html), use:
# module_support/atk_setup playwright
# == For Automated Testing Kit Contributors ==
# Copy the tests located in <project root>/tests to the repo
# (often located in <project root>/web/modules/contrib/automated_testing_kit),
# use:
# module_support/atk_setup playwright back
# atk_setup <tool> <do_link>
# tool = playwright OR cypress
# do_link = "link" or blank
# ATTENTION:
# Before using this tool, set the project root directory below.
WEB_ROOT_DIR
=
"web"
MODULE_DIR
=
"modules/contrib/automated_testing_kit"
MODULE_SUPPORT_DIR
=
$WEB_ROOT_DIR
/
$MODULE_DIR
/module_support
@@ -18,13 +34,19 @@ if [ -z "$1" ]; then
exit
1
fi
DO_COPY
=
1
DO_BACK
=
0
DO_LINK
=
0
if
[
!
-z
"
$2
"
]
;
then
if
[
"
$2
"
!=
'link'
]
;
then
echo
"Second parameter allowed to be only 'link'."
DO_COPY
=
0
if
[
"
$2
"
==
'back'
]
;
then
DO_BACK
=
1
elif
[
"
$2
"
==
'link'
]
;
then
DO_LINK
=
1
else
echo
"Second parameter must be 'back'|'link'."
exit
1
fi
DO_LINK
=
1
fi
# Check if in project root by testing for presence of package.json.
@@ -63,6 +85,7 @@ fi
#
# Copy xx.atk.config.js to the project root.
#
if
[[
$DO_BACK
==
0
]]
;
then
if
[
"
$1
"
==
"cypress"
]
;
then
echo
"Copying cypress.atk.config.js to <project_root>/cypress.atk.config.js."
cp
$MODULE_SUPPORT_DIR
/cypress.atk.config.js
.
@@ -70,18 +93,24 @@ else
echo
"Copying playwright.atk.config.js to <project_root>/playwright.atk.config.js."
cp
$MODULE_SUPPORT_DIR
/playwright.atk.config.js
.
fi
fi
#
# Copy or link framework tests.
#
echo
"Copying or linking tests to <project_root>/
$TEST_DESTINATION_DIR
."
if
((
$DO_LINK
==
0
))
;
then
if
[[
$DO_COPY
==
1
]]
;
then
echo
"Copying tests to <project_root>/
$TEST_DESTINATION_DIR
."
# Ensure the destination directory exists.
mkdir
${
TEST_DESTINATION_DIR
}
mkdir
-p
${
TEST_DESTINATION_DIR
}
cp
-R
$TEST_SOURCE_DIR
/
*
$TEST_DESTINATION_DIR
else
elif
[[
$DO_BACK
==
1
]]
;
then
echo
"Copying tests back to
$TEST_SOURCE_DIR
."
cp
-R
$TEST_DESTINATION_DIR
/atk
**
$TEST_SOURCE_DIR
elif
[[
$DO_LINK
==
1
]]
;
then
echo
"Linking tests to <project_root>/
$TEST_DESTINATION_DIR
."
# Can't link the parent source directory so need to iterate through
# just test directories to link individual tests.
TESTS
=
$(
find
"
${
TEST_SOURCE_DIR
}
"
-mindepth
1
-type
d
)
@@ -104,19 +133,32 @@ fi
#
# Copy or link data files.
#
echo
"Copying or linking data files to <project_root>/
$DATA_DESTINATION_DIR
."
if
((
$DO_LINK
==
0
))
;
then
if
[[
$DO_COPY
==
1
]]
;
then
echo
"Copying data files to <project_root>/
$DATA_DESTINATION_DIR
."
cp
-R
$DATA_SOURCE_DIR
$DATA_DESTINATION_DIR
else
elif
[[
$DO_BACK
==
1
]]
;
then
echo
"Copying data files back to
$DATA_SOURCE_DIR
."
cp
-R
$DATA_DESTINATION_DIR
/data/
*
$DATA_SOURCE_DIR
elif
[[
$DO_LINK
==
1
]]
;
then
echo
"Linking data files to <project_root>/
$DATA_DESTINATION_DIR
."
ln
-s
"
$PWD
/
$DATA_SOURCE_DIR
"
"
$PWD
/
$DATA_DESTINATION_DIR
"
fi
#
# Copy or link testing framework support files.
#
echo
"Copying or linking test framework support files to <project_root>/
$SUPPORT_DESTINATION_DIR
."
if
((
$DO_LINK
==
0
))
;
then
if
[[
$DO_COPY
==
1
]]
;
then
echo
"Copying test framework support files to <project_root>/
$SUPPORT_DESTINATION_DIR
."
cp
-R
$SUPPORT_SOURCE_DIR
$SUPPORT_DESTINATION_DIR
else
elif
[[
$DO_BACK
==
1
]]
;
then
echo
"Copying test framework support files back to
$SUPPORT_SOURCE_DIR
."
cp
-R
$SUPPORT_DESTINATION_DIR
/support/
*
$SUPPORT_SOURCE_DIR
elif
[[
$DO_LINK
==
1
]]
;
then
echo
"Linking test framework support files to <project_root>/
$SUPPORT_DESTINATION_DIR
."
ln
-s
"
$PWD
/
$SUPPORT_SOURCE_DIR
"
"
$PWD
/
$SUPPORT_DESTINATION_DIR
"
fi
Loading