From 0b964bde38971e2f525bb637483d11cadf329d08 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Wed, 25 Sep 2024 11:48:45 +0200 Subject: [PATCH 01/11] BUGFIX: Prevent augmenter from applying data of multiple nodes into the same element This fixes a regression introduced in #b56135a01ecf59ae3a4990e3fd54ac766732e0e6 which removed the script tag, causing the augmenter to add the data of multiple nodes into the same html element in certain cases instead of adding an outer div. With this change this behaviour is now more explicit instead of relying on the inner workings of the augmenter. --- Classes/Aspects/AugmentationAspect.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Classes/Aspects/AugmentationAspect.php b/Classes/Aspects/AugmentationAspect.php index 281e812d1f..1138d150de 100644 --- a/Classes/Aspects/AugmentationAspect.php +++ b/Classes/Aspects/AugmentationAspect.php @@ -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) + ); } /** From 6c619b24d5c529af6982bed2ac294a9dae3690e4 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 26 Sep 2024 21:23:56 +0200 Subject: [PATCH 02/11] TASK: Run tests also on chrome in ci --- .sauce/config1Dimension.yml | 2 +- .sauce/config2Dimension.yml | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.sauce/config1Dimension.yml b/.sauce/config1Dimension.yml index f6eeb61ef0..90462c5f6e 100644 --- a/.sauce/config1Dimension.yml +++ b/.sauce/config1Dimension.yml @@ -26,7 +26,7 @@ suites: smartRetry: failedOnly: true - name: "One dimensional Tests in Firefox on MacOS" - browserName: "firefox" + browserName: "chrome" src: - "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" platformName: "macOS 13" diff --git a/.sauce/config2Dimension.yml b/.sauce/config2Dimension.yml index 30bc6a38c2..e32fef1852 100644 --- a/.sauce/config2Dimension.yml +++ b/.sauce/config2Dimension.yml @@ -25,7 +25,7 @@ suites: smartRetry: failedOnly: true - name: "Two dimensional Tests in Firefox on MacOS" - browserName: "firefox" + browserName: "chrome" src: - "Tests/IntegrationTests/Fixtures/2Dimension/*.e2e.js" platformName: "macOS 13" diff --git a/README.md b/README.md index 689b0d85c4..1e03152ec4 100644 --- a/README.md +++ b/README.md @@ -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 ` - * 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 From e5d48feee0353dc885b1a7020417cc1cd9cb92ff Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 26 Sep 2024 23:24:26 +0200 Subject: [PATCH 03/11] BUGFIX: Stabilise test locally to have deterministic inspector groups positioning When the inspector tab panel is scrolled just enough, so that there\'s enough space, SelectBox contents jump below the SelectBox. Would fail otherwise because "document" would be before "tests" --- .../Document/SelectBoxTestPage/OpensAboveInInspector.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tests/IntegrationTests/SharedNodeTypesPackage/NodeTypes/Document/SelectBoxTestPage/OpensAboveInInspector.yaml b/Tests/IntegrationTests/SharedNodeTypesPackage/NodeTypes/Document/SelectBoxTestPage/OpensAboveInInspector.yaml index 5365e250e1..f89d08f1c3 100644 --- a/Tests/IntegrationTests/SharedNodeTypesPackage/NodeTypes/Document/SelectBoxTestPage/OpensAboveInInspector.yaml +++ b/Tests/IntegrationTests/SharedNodeTypesPackage/NodeTypes/Document/SelectBoxTestPage/OpensAboveInInspector.yaml @@ -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 From 20dfb5a6c50b85e8975733b7b49480d753f9e416 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 26 Sep 2024 23:52:28 +0200 Subject: [PATCH 04/11] WIP attempt to fix screen size for mac e2e tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✖ Select Boxes - SelectBox opens above in creation dialog if there's not enough space below. 1) Unable to resize the window because the specified size exceeds the screen size. On macOS, a window cannot be larger than the screen. Browser: Chrome 129.0.0.0 / Ventura 13 21 | .gt(await ReactSelector('NodeCreationDialog SelectBox').getBoundingClientRectProperty('top')); 22 |}); 23 | 24 |test('SelectBox opens above in creation dialog if there\'s not enough space below.', async t => { 25 | await t > 26 | .resizeWindow(1200, 768) --- .sauce/config1Dimension.yml | 4 ++-- .sauce/config2Dimension.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.sauce/config1Dimension.yml b/.sauce/config1Dimension.yml index 90462c5f6e..69735dba7d 100644 --- a/.sauce/config1Dimension.yml +++ b/.sauce/config1Dimension.yml @@ -25,12 +25,12 @@ suites: screenResolution: "1280x1024" smartRetry: failedOnly: true - - name: "One dimensional Tests in Firefox on MacOS" + - name: "One dimensional Tests in Chrome on MacOS" browserName: "chrome" src: - "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" platformName: "macOS 13" - screenResolution: "1440x900" + screenResolution: "1920x1080" smartRetry: failedOnly: true npm: diff --git a/.sauce/config2Dimension.yml b/.sauce/config2Dimension.yml index e32fef1852..879f749d55 100644 --- a/.sauce/config2Dimension.yml +++ b/.sauce/config2Dimension.yml @@ -24,12 +24,12 @@ suites: screenResolution: "1280x1024" smartRetry: failedOnly: true - - name: "Two dimensional Tests in Firefox on MacOS" + - name: "Two dimensional Tests in Chrome on MacOS" browserName: "chrome" src: - "Tests/IntegrationTests/Fixtures/2Dimension/*.e2e.js" platformName: "macOS 13" - screenResolution: "1440x900" + screenResolution: "1920x1080" smartRetry: failedOnly: true npm: From 490d7ddfe0710ffe7447e4ab2c6ad511c5a9a99c Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 26 Sep 2024 23:52:48 +0200 Subject: [PATCH 05/11] TASK: Cleanup bash script --- Tests/IntegrationTests/e2e.sh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Tests/IntegrationTests/e2e.sh b/Tests/IntegrationTests/e2e.sh index d3b5466ae1..79ba2d41ca 100755 --- a/Tests/IntegrationTests/e2e.sh +++ b/Tests/IntegrationTests/e2e.sh @@ -9,7 +9,7 @@ parse_arguments() { while [[ $# -gt 0 ]]; do case "$1" in -h|--help) - usage + print_usage_information exit 0 ;; -s|--saucelabs) @@ -21,7 +21,7 @@ parse_arguments() { ;; *) echo "Unknown option: $1" - usage + print_usage_information exit 1 ;; esac @@ -29,15 +29,14 @@ parse_arguments() { done } -# Function to print usage information -usage() { +print_usage_information() { cat < /dev/null; then echo "saucectl is not installed. Installing saucectl..." @@ -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" @@ -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) @@ -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 From ae48b7fba1fe903583827be4fa4ee9b0b407f914 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 27 Sep 2024 00:05:27 +0200 Subject: [PATCH 06/11] TASK: Add exit 1 handling in case of failed test suite --- Tests/IntegrationTests/e2e.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Tests/IntegrationTests/e2e.sh b/Tests/IntegrationTests/e2e.sh index 79ba2d41ca..4b5c3c9bec 100755 --- a/Tests/IntegrationTests/e2e.sh +++ b/Tests/IntegrationTests/e2e.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -ex + # Global variables BROWSER="" USE_SAUCELABS=false @@ -118,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 @@ -132,6 +134,10 @@ function run_tests() { rm -rf DistributionPackages mv DummyDistributionPackages DistributionPackages + + if [[ $hasFailure -eq 1 ]] ; then + exit 1 + fi } parse_arguments "$@" From 99e989fcaabba5cfb49fc6a71a59fb1cc69ac195 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 27 Sep 2024 00:28:54 +0200 Subject: [PATCH 07/11] wip try a valid screen size > WRN Suite errored. error="job start failed (404): Misconfigured -- Resolution you specified is not available for this OS/browser/version/device combo: OS: 'Mac 13', Browser: 'googlechrome', Version: '129.0.6668.59', Device: 'unspecified', Screen Resolution: '1920x1080'; available resolutions: '1024x768', '1152x864', '1280x960', '1376x1032', '1440x900', '1600x1200', '1920x1440', '2048x1536'" --- .sauce/config1Dimension.yml | 2 +- .sauce/config2Dimension.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.sauce/config1Dimension.yml b/.sauce/config1Dimension.yml index 69735dba7d..f145599df9 100644 --- a/.sauce/config1Dimension.yml +++ b/.sauce/config1Dimension.yml @@ -30,7 +30,7 @@ suites: src: - "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" platformName: "macOS 13" - screenResolution: "1920x1080" + screenResolution: "1600x1200" smartRetry: failedOnly: true npm: diff --git a/.sauce/config2Dimension.yml b/.sauce/config2Dimension.yml index 879f749d55..19e26ad202 100644 --- a/.sauce/config2Dimension.yml +++ b/.sauce/config2Dimension.yml @@ -29,7 +29,7 @@ suites: src: - "Tests/IntegrationTests/Fixtures/2Dimension/*.e2e.js" platformName: "macOS 13" - screenResolution: "1920x1080" + screenResolution: "1600x1200" smartRetry: failedOnly: true npm: From 7635925cb732e357479304d2cd878574a131f02b Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 27 Sep 2024 10:15:05 +0200 Subject: [PATCH 08/11] TASK: remove retry for now in e2e The retrys just fail: Sauce TestCafe Runner 3.9.0 2Running TestCafe 3.6.2 8Error: Cannot find module '/Volumes/Sauce/node/20.14.0/node-v20.14.0-darwin-x64/bin/node_modules/npm/bin/npm-cli.js' 25 26Error: Cannot find module '/Volumes/Sauce/node/20.14.0/node-v20.14.0-darwin-x64/bin/node_modules/npm/bin/npm-cli.js' 56ERROR No tests match your filter. 57See https://testcafe.io/documentation/402638/reference/configuration-file#filter. 58 59Type "testcafe -h" for help. 60JUnit file generation skipped: no test suites detected. --- .sauce/config1Dimension.yml | 6 +----- .sauce/config2Dimension.yml | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.sauce/config1Dimension.yml b/.sauce/config1Dimension.yml index f145599df9..5037dd61e3 100644 --- a/.sauce/config1Dimension.yml +++ b/.sauce/config1Dimension.yml @@ -4,7 +4,7 @@ showConsoleLog: true sauce: region: us-west-1 concurrency: 1 # Controls how many suites are executed at the same time. - retries: 3 + retries: 0 metadata: tags: - e2e @@ -23,16 +23,12 @@ suites: - "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" platformName: "Windows 10" screenResolution: "1280x1024" - smartRetry: - failedOnly: true - name: "One dimensional Tests in Chrome on MacOS" browserName: "chrome" src: - "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" platformName: "macOS 13" screenResolution: "1600x1200" - smartRetry: - failedOnly: true npm: dependencies: - testcafe-react-selectors diff --git a/.sauce/config2Dimension.yml b/.sauce/config2Dimension.yml index 19e26ad202..f31c368f90 100644 --- a/.sauce/config2Dimension.yml +++ b/.sauce/config2Dimension.yml @@ -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 @@ -22,16 +22,12 @@ suites: - "Tests/IntegrationTests/Fixtures/2Dimension/*.e2e.js" platformName: "Windows 10" screenResolution: "1280x1024" - smartRetry: - failedOnly: true - name: "Two dimensional Tests in Chrome on MacOS" browserName: "chrome" src: - "Tests/IntegrationTests/Fixtures/2Dimension/*.e2e.js" platformName: "macOS 13" screenResolution: "1600x1200" - smartRetry: - failedOnly: true npm: dependencies: - testcafe-react-selectors From f06551e88f84753bc0f089847e9888cca01bac64 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:41:55 +0200 Subject: [PATCH 09/11] wip reset screen size --- .sauce/config1Dimension.yml | 2 +- .sauce/config2Dimension.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.sauce/config1Dimension.yml b/.sauce/config1Dimension.yml index 5037dd61e3..7465f03137 100644 --- a/.sauce/config1Dimension.yml +++ b/.sauce/config1Dimension.yml @@ -28,7 +28,7 @@ suites: src: - "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" platformName: "macOS 13" - screenResolution: "1600x1200" + screenResolution: "1440x900" npm: dependencies: - testcafe-react-selectors diff --git a/.sauce/config2Dimension.yml b/.sauce/config2Dimension.yml index f31c368f90..80ebb74ad7 100644 --- a/.sauce/config2Dimension.yml +++ b/.sauce/config2Dimension.yml @@ -27,7 +27,7 @@ suites: src: - "Tests/IntegrationTests/Fixtures/2Dimension/*.e2e.js" platformName: "macOS 13" - screenResolution: "1600x1200" + screenResolution: "1440x900" npm: dependencies: - testcafe-react-selectors From e3d44253cd4cb72ee73c3c110dc18db439bcdb65 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:51:07 +0200 Subject: [PATCH 10/11] wip revert test resize hack `resizeWindow` as mac os on e2e will fail see 20dfb5a6c50b85e8975733b7b49480d753f9e416 https://github.com/neos/neos-ui/pull/3275 --- Tests/IntegrationTests/Fixtures/1Dimension/selectBoxes.e2e.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/IntegrationTests/Fixtures/1Dimension/selectBoxes.e2e.js b/Tests/IntegrationTests/Fixtures/1Dimension/selectBoxes.e2e.js index ae67757496..0391dce32b 100644 --- a/Tests/IntegrationTests/Fixtures/1Dimension/selectBoxes.e2e.js +++ b/Tests/IntegrationTests/Fixtures/1Dimension/selectBoxes.e2e.js @@ -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')); From 9aaa70ff401bc85bba0b677c1ad026ad2f1e08b7 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:21:09 +0200 Subject: [PATCH 11/11] give up --- .sauce/config1Dimension.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.sauce/config1Dimension.yml b/.sauce/config1Dimension.yml index 7465f03137..48bd751dd2 100644 --- a/.sauce/config1Dimension.yml +++ b/.sauce/config1Dimension.yml @@ -4,6 +4,7 @@ showConsoleLog: true sauce: region: us-west-1 concurrency: 1 # Controls how many suites are executed at the same time. + # todo fix and enable retries retries: 0 metadata: tags: @@ -23,8 +24,9 @@ suites: - "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" platformName: "Windows 10" screenResolution: "1280x1024" - - name: "One dimensional Tests in Chrome on MacOS" - browserName: "chrome" + - name: "One dimensional Tests in Firefox on MacOS" + # todo use chrome here and fix ci https://github.com/neos/neos-ui/issues/3591 + browserName: "firefox" src: - "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" platformName: "macOS 13"