Skip to content

Commit

Permalink
TASK: Cleanup bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Sep 26, 2024
1 parent 20dfb5a commit 490d7dd
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions Tests/IntegrationTests/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ parse_arguments() {
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
usage
print_usage_information
exit 0
;;
-s|--saucelabs)
Expand All @@ -21,23 +21,22 @@ parse_arguments() {
;;
*)
echo "Unknown option: $1"
usage
print_usage_information
exit 1
;;
esac
shift
done
}

# Function to print usage information
usage() {
print_usage_information() {
cat <<EOF
Usage: $0 [options]
Options:
-h, --help Show this help message
-s, --saucelabs Enable remote browser from SauceLabs
-b, --browser Specify local browser to use
-s, --saucelabs Run in remote browser from SauceLabs configured in .sauce
-b, --browser Run in specified local browser
EOF
}

Expand Down Expand Up @@ -66,7 +65,6 @@ function check_saucectl_variables {
fi
}

# Check if saucectl is installed
function check_saucectl_installed {
if ! command -v saucectl &> /dev/null; then
echo "saucectl is not installed. Installing saucectl..."
Expand All @@ -75,7 +73,7 @@ function check_saucectl_installed {
fi
}

# get dimension from fixture
# parse dimension from fixture file name
function get_dimension() {
dimension=$(basename "$1")
echo "$dimension"
Expand All @@ -88,7 +86,6 @@ function initialize_neos_site() {

ln -s "../${fixture}SitePackage" DistributionPackages/Neos.TestSite

# TODO: optimize this
composer reinstall neos/test-nodetypes
composer reinstall neos/test-site
# make sure neos is installed even if patching led to the removal (bug)
Expand Down Expand Up @@ -137,12 +134,10 @@ function run_tests() {
mv DummyDistributionPackages DistributionPackages
}

# Parse arguments
parse_arguments "$@"

# check if incoming parameters are correct
check_testcafe_browser
check_saucelabs_setup

# Run the tests
run_tests

0 comments on commit 490d7dd

Please sign in to comment.