Skip to content

Commit

Permalink
Merge branch '8.3' into backport-e2e-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markusguenther authored Sep 27, 2024
2 parents 8f37ddd + cb36295 commit 45b8f57
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .sauce/config1Dimension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ showConsoleLog: true
sauce:
region: us-west-1
concurrency: 1 # Controls how many suites are executed at the same time.
retries: 3
# todo fix and enable retries
retries: 0
metadata:
tags:
- e2e
Expand Down
2 changes: 1 addition & 1 deletion .sauce/config2Dimension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: testcafe
sauce:
region: us-west-1
concurrency: 1 # Controls how many suites are executed at the same time.
retries: 3
retries: 0
metadata:
tags:
- e2e
Expand Down
10 changes: 9 additions & 1 deletion Classes/Aspects/AugmentationAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ public function contentElementAugmentation(JoinPointInterface $joinPoint)
$attributes['data-__neos-node-contextpath'] = $node->getContextPath();
$attributes['data-__neos-fusion-path'] = $fusionPath;

return $this->htmlAugmenter->addAttributes($content, $attributes);
// Define all attribute names as exclusive via the `exclusiveAttributes` parameter, to prevent the data of
// two different nodes to be concatenated into the attributes of a single html node.
// This way an outer div is added, if the wrapped content already has node related data-attributes set.
return $this->htmlAugmenter->addAttributes(
$content,
$attributes,
'div',
array_keys($attributes)
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ To speed up the e2e-test workflow/feedback loop you can start the system under t
* The neos dev instance is available at `localhost:8081`
* To enter the container run `docker compose -f Tests/IntegrationTests/docker-compose.neos-dev-instance.yaml exec php bash`
* `yarn run testcafe <browser> <testFile> <optional flags>`
* for example, this runs all tests in chrome: (NOTE starting with Chrome 127, --disable-search-engine-choice-screen is needed)
* for example, this runs all tests in chrome: (NOTE starting with Chrome 127, --disable-search-engine-choice-screen is needed until https://github.com/DevExpress/testcafe/pull/8248 is released)
`yarn run testcafe chrome:--disable-search-engine-choice-screen Tests/IntegrationTests/Fixtures/1Dimension`
* some helpful optional flags are
* `-T 'sidebars'` - grep tests by pattern and only execute those
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ test('SelectBox opens below and breaks out of the creation dialog if there\'s en

test('SelectBox opens above in creation dialog if there\'s not enough space below.', async t => {
await t
.resizeWindow(1200, 768)
.click(Selector('#neos-PageTree-AddNode'))
.click(ReactSelector('NodeTypeItem').withExactText('SelectBox opens above'))
.click(ReactSelector('NodeCreationDialog SelectBox'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
groups:
test:
label: Test
# move it before the general document meta-data so there is
# also space below when opening it in the e2e tests
position: start
properties:
TextField:
type: string
Expand Down
27 changes: 14 additions & 13 deletions Tests/IntegrationTests/e2e.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -ex

# Global variables
BROWSER=""
USE_SAUCELABS=false
Expand All @@ -9,7 +11,7 @@ parse_arguments() {
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
usage
print_usage_information
exit 0
;;
-s|--saucelabs)
Expand All @@ -21,23 +23,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 +67,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 +75,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 +88,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 @@ -121,11 +120,11 @@ function run_tests() {
cd Packages/Application/Neos.Neos.Ui

if [[ $BROWSER ]]; then
yarn run testcafe "$BROWSER" "../../../${fixture}*.e2e.js" --selector-timeout=10000 --assertion-timeout=30000
yarn run testcafe "$BROWSER" "../../../${fixture}*.e2e.js" --selector-timeout=10000 --assertion-timeout=30000 || hasFailure=1
fi

if [[ $USE_SAUCELABS ]]; then
saucectl run --config .sauce/config${dimension}.yml
saucectl run --config .sauce/config${dimension}.yml || hasFailure=1
fi

# cd back to the root directory and clean up
Expand All @@ -135,14 +134,16 @@ function run_tests() {

rm -rf DistributionPackages
mv DummyDistributionPackages DistributionPackages

if [[ $hasFailure -eq 1 ]] ; then
exit 1
fi
}

# 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 45b8f57

Please sign in to comment.