From bde2b18163f5df7f6800704287d45f72132c8d25 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Wed, 3 Jan 2024 14:50:18 -0400 Subject: [PATCH 01/12] Theoretical trying to use chromedriver. --- .github/workflows/build-2.x.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index 2ab3a539e..c820fe914 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -47,6 +47,11 @@ jobs: - 8161:8161 - 61616:61616 - 61613:61613 + chrome: + image: drupalci/webdriver-chromedriver:production + ports: + - 9515:9515 + options: --entrypoint 'chromedriver --log-path=/tmp/chromedriver.log --verbose --allowed-ips= --allowed-origins=*' # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -117,6 +122,9 @@ jobs: run: $SCRIPT_DIR/travis_scripts.sh - name: PHPUNIT tests + env: + MINK_DRIVER_ARGS: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://chrome:9515"]' + MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://chrome:9515"]' run: | cd $DRUPAL_DIR/web/core $DRUPAL_DIR/vendor/bin/phpunit --verbose --testsuite "${{ matrix.test-suite }}" From 6d14ca1c31803f13fadd3ef5b954d2da79374dc2 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Wed, 3 Jan 2024 14:56:17 -0400 Subject: [PATCH 02/12] Avoid trying to pass the entry point. --- .github/workflows/build-2.x.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index c820fe914..2851956b8 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -51,7 +51,8 @@ jobs: image: drupalci/webdriver-chromedriver:production ports: - 9515:9515 - options: --entrypoint 'chromedriver --log-path=/tmp/chromedriver.log --verbose --allowed-ips= --allowed-origins=*' + # XXX: Doesn't presently work; however, seems to represent the current default. + #options: --entrypoint 'chromedriver --log-path=/tmp/chromedriver.log --verbose --allowed-ips= --allowed-origins=*' # Steps represent a sequence of tasks that will be executed as part of the job steps: From 63a2f760569ab94662601b901e332678403b5e1d Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 06:44:31 -0400 Subject: [PATCH 03/12] Install chromedriver on host since GitHub services can't access host ports --- .github/workflows/build-2.x.yml | 62 ++++++++++++++++----------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index 2851956b8..7e2d54b15 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -1,34 +1,35 @@ -# This is a basic workflow to help you get started with Actions - name: CI -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the 2.x branch push: branches: [ 2.x ] pull_request: branches: [ 2.x ] - - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on + env: + DRUPAL_VERSION: ${{ matrix.drupal-version }} + SCRIPT_DIR: ${{ github.workspace }}/islandora_ci + DRUPAL_DIR: /opt/drupal + PHPUNIT_FILE: ${{ github.workspace }}/build_dir/phpunit.xml + MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://localhost:9515"]' + CHROMEDRIVER_VERSION: 114.0.5735.90 + runs-on: ubuntu-latest continue-on-error: ${{ matrix.allowed_failure }} strategy: fail-fast: false matrix: - php-versions: ["8.1", "8.2"] - # test-suite functional-javascript will appear to pass but will skip tests; missing chromedriver. + php-versions: ["8.1", "8.2", "8.3"] test-suite: ["kernel", "functional", "functional-javascript"] - drupal-version: ["10.0.x", "10.1.x", "10.2.x-dev"] + drupal-version: ["10.1.x", "10.2.x", "10.3.x-dev"] mysql: ["8.0"] allowed_failure: [false] + exclude: + - php-versions: "8.3" + drupal-version: "10.1.x" name: PHP ${{ matrix.php-versions }} | drupal ${{ matrix.drupal-version }} | mysql ${{ matrix.mysql }} | test-suite ${{ matrix.test-suite }} @@ -47,24 +48,16 @@ jobs: - 8161:8161 - 61616:61616 - 61613:61613 - chrome: - image: drupalci/webdriver-chromedriver:production - ports: - - 9515:9515 - # XXX: Doesn't presently work; however, seems to represent the current default. - #options: --entrypoint 'chromedriver --log-path=/tmp/chromedriver.log --verbose --allowed-ips= --allowed-origins=*' - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: build_dir - name: Checkout islandora_ci - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: islandora/islandora_ci ref: github-actions @@ -82,13 +75,6 @@ jobs: sudo apt-get remove -y mysql-client mysql-common sudo apt-get install -y mysql-client - - name: Set environment variables - run: | - echo "DRUPAL_VERSION=${{ matrix.drupal-version }}" >> $GITHUB_ENV - echo "SCRIPT_DIR=$GITHUB_WORKSPACE/islandora_ci" >> $GITHUB_ENV - echo "DRUPAL_DIR=/opt/drupal" >> $GITHUB_ENV - echo "PHPUNIT_FILE=$GITHUB_WORKSPACE/build_dir/phpunit.xml" >> $GITHUB_ENV - - name: Cache Composer dependencies uses: actions/cache@v3 with: @@ -121,11 +107,23 @@ jobs: - name: Test scripts run: $SCRIPT_DIR/travis_scripts.sh + + - name: Start chromedriver + if: matrix.test-suite == 'functional-javascript' + run: |- + curl -s -o ./chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip + unzip chromedriver_linux64.zip + ./chromedriver \ + --log-path=/tmp/chromedriver.log \ + --verbose \ + --allowed-ips= \ + --allowed-origins=* & - name: PHPUNIT tests - env: - MINK_DRIVER_ARGS: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://chrome:9515"]' - MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://chrome:9515"]' run: | cd $DRUPAL_DIR/web/core $DRUPAL_DIR/vendor/bin/phpunit --verbose --testsuite "${{ matrix.test-suite }}" + + - name: Print chromedriver logs + if: matrix.test-suite == 'functional-javascript' + run: cat /tmp/chromedriver.log From 74a0cf504c8890c859a2d3043153a065039f001f Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 07:05:16 -0400 Subject: [PATCH 04/12] Fetch latest stable chromedriver from JSON endpoint --- .github/workflows/build-2.x.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index 7e2d54b15..15617d2bb 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -15,7 +15,6 @@ jobs: DRUPAL_DIR: /opt/drupal PHPUNIT_FILE: ${{ github.workspace }}/build_dir/phpunit.xml MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://localhost:9515"]' - CHROMEDRIVER_VERSION: 114.0.5735.90 runs-on: ubuntu-latest continue-on-error: ${{ matrix.allowed_failure }} @@ -111,7 +110,8 @@ jobs: - name: Start chromedriver if: matrix.test-suite == 'functional-javascript' run: |- - curl -s -o ./chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip + CHROMEDRIVER_URL=$(curl -s "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json"| jq -r '.channels.Stable.downloads.chromedriver[]| select(.platform == "linux64") | .url') + curl -s -o ./chromedriver_linux64.zip $CHROMEDRIVER_URL unzip chromedriver_linux64.zip ./chromedriver \ --log-path=/tmp/chromedriver.log \ From 3100f5005861d0d4070b79be6653bb5c0290212c Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 07:11:14 -0400 Subject: [PATCH 05/12] Binary is in a new location --- .github/workflows/build-2.x.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index 15617d2bb..2ebfc7f4a 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -113,6 +113,7 @@ jobs: CHROMEDRIVER_URL=$(curl -s "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json"| jq -r '.channels.Stable.downloads.chromedriver[]| select(.platform == "linux64") | .url') curl -s -o ./chromedriver_linux64.zip $CHROMEDRIVER_URL unzip chromedriver_linux64.zip + cd chromedriver-linux64 ./chromedriver \ --log-path=/tmp/chromedriver.log \ --verbose \ From 466ecb0e61cc2b25b3ce66cea746966ad02dcfd9 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 07:20:15 -0400 Subject: [PATCH 06/12] chromedriver is already installed --- .github/workflows/build-2.x.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index 2ebfc7f4a..b54d5caf2 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -110,11 +110,7 @@ jobs: - name: Start chromedriver if: matrix.test-suite == 'functional-javascript' run: |- - CHROMEDRIVER_URL=$(curl -s "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json"| jq -r '.channels.Stable.downloads.chromedriver[]| select(.platform == "linux64") | .url') - curl -s -o ./chromedriver_linux64.zip $CHROMEDRIVER_URL - unzip chromedriver_linux64.zip - cd chromedriver-linux64 - ./chromedriver \ + /usr/local/share/chromedriver-linux64 \ --log-path=/tmp/chromedriver.log \ --verbose \ --allowed-ips= \ From 56ce71336c0150ea05c0ec8b2f8cc1b2a1ffedc5 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 07:25:43 -0400 Subject: [PATCH 07/12] apparently that's a directory --- .github/workflows/build-2.x.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index b54d5caf2..84efdbf79 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -110,7 +110,8 @@ jobs: - name: Start chromedriver if: matrix.test-suite == 'functional-javascript' run: |- - /usr/local/share/chromedriver-linux64 \ + ls -l /usr/local/share/chromedriver-linux64 + /usr/local/share/chromedriver-linux64/chromedriver \ --log-path=/tmp/chromedriver.log \ --verbose \ --allowed-ips= \ From e58adb7fa5b87d9d8a570eb5d81a6b4e65af87d7 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 07:36:09 -0400 Subject: [PATCH 08/12] Fixup js tests --- .../views.view.test_integer_weight.yml | 221 ++++++++++-------- .../IntegerWeightTest.php | 5 +- 2 files changed, 130 insertions(+), 96 deletions(-) diff --git a/tests/modules/integer_weight_test_views/test_views/views.view.test_integer_weight.yml b/tests/modules/integer_weight_test_views/test_views/views.view.test_integer_weight.yml index 08dc4912a..9ccb76a81 100644 --- a/tests/modules/integer_weight_test_views/test_views/views.view.test_integer_weight.yml +++ b/tests/modules/integer_weight_test_views/test_views/views.view.test_integer_weight.yml @@ -4,6 +4,7 @@ dependencies: config: - node.type.repo_item module: + - islandora - node - user id: test_integer_weight @@ -13,87 +14,36 @@ description: '' tag: '' base_table: node_field_data base_field: nid -core: 8.x display: default: - display_plugin: default id: default display_title: Master + display_plugin: default position: 0 display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - row: - type: fields + title: 'test weight' fields: title: id: title table: node_field_data field: title + relationship: none + group_type: group + admin_label: '' entity_type: node entity_field: title + plugin_id: field + label: Title + exclude: false alter: alter_text: false make_link: false absolute: false - trim: false word_boundary: false ellipsis: false strip_tags: false + trim: false html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: Title - exclude: false element_type: '' element_class: '' element_label_type: '' @@ -103,9 +53,13 @@ display: element_wrapper_class: '' element_default_classes: true empty: '' + hide_empty: false + empty_zero: false hide_alter_empty: true click_sort_column: value type: string + settings: + link_to_entity: true group_column: value group_columns: { } group_rows: true @@ -123,7 +77,8 @@ display: relationship: none group_type: group admin_label: '' - label: 'Integer weight selector (field_integer_weight)' + plugin_id: integer_weight_selector + label: 'Integer Weight Selector (field_integer_weight)' exclude: false alter: alter_text: false @@ -164,44 +119,57 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - range: '20' - plugin_id: integer_weight_selector - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status + pager: + type: mini + options: + offset: 0 + items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ expose: - operator: '' - group: 1 - type: - id: type - table: node_field_data - field: type - value: - repo_item:repo_item - entity_type: node - entity_field: type - plugin_id: bundle + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + empty: { } sorts: created: id: created table: node_field_data field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date relationship: none group_type: group admin_label: '' - exposed: false + entity_type: node + entity_field: created + plugin_id: date + order: DESC expose: label: '' + exposed: false granularity: second field_integer_weight_value: id: field_integer_weight_value @@ -210,17 +178,82 @@ display: relationship: none group_type: group admin_label: '' + plugin_id: standard order: ASC + expose: + label: '' + field_identifier: '' + exposed: false + arguments: { } + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: type + plugin_id: bundle + operator: in + value: + repo_item: repo_item + group: 1 exposed: false expose: + operator_id: '' label: '' - plugin_id: standard - title: 'test weight' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + style: + type: table + row: + type: fields + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: false + replica: false + query_tags: { } + relationships: { } header: { } footer: { } - empty: { } - relationships: { } - arguments: { } display_extenders: { } cache_metadata: max-age: -1 @@ -232,9 +265,9 @@ display: - user.permissions tags: { } page_1: - display_plugin: page id: page_1 display_title: Page + display_plugin: page position: 1 display_options: display_extenders: { } diff --git a/tests/src/FunctionalJavascript/IntegerWeightTest.php b/tests/src/FunctionalJavascript/IntegerWeightTest.php index 2572c191e..4f07be962 100644 --- a/tests/src/FunctionalJavascript/IntegerWeightTest.php +++ b/tests/src/FunctionalJavascript/IntegerWeightTest.php @@ -8,6 +8,7 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\field\Entity\FieldConfig; use Drupal\node\Entity\Node; +use Drupal\views\Tests\ViewTestData; /** * Test integer weight selector. @@ -102,7 +103,7 @@ public function setUp(): void { $this->container->get('router.builder')->rebuild(); $fieldStorage = FieldStorageConfig::create([ - 'fieldName' => static::$fieldName, + 'field_name' => static::$fieldName, 'entity_type' => 'node', 'type' => static::$fieldType, ]); @@ -124,7 +125,7 @@ public function setUp(): void { $this->nodes[] = $node; } - ViewsTestData::createTestViews(get_class($this), ['integer_weight_test_views']); + ViewTestData::createTestViews(get_class($this), ['integer_weight_test_views']); } /** From b13f980e46939b05dc2e65e71a21140fce1d41f6 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 08:38:44 -0400 Subject: [PATCH 09/12] Move MINK env var into phpunit for easier local testing --- .github/workflows/build-2.x.yml | 2 -- phpunit.xml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index 84efdbf79..8cd9f1d1e 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -14,7 +14,6 @@ jobs: SCRIPT_DIR: ${{ github.workspace }}/islandora_ci DRUPAL_DIR: /opt/drupal PHPUNIT_FILE: ${{ github.workspace }}/build_dir/phpunit.xml - MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://localhost:9515"]' runs-on: ubuntu-latest continue-on-error: ${{ matrix.allowed_failure }} @@ -110,7 +109,6 @@ jobs: - name: Start chromedriver if: matrix.test-suite == 'functional-javascript' run: |- - ls -l /usr/local/share/chromedriver-linux64 /usr/local/share/chromedriver-linux64/chromedriver \ --log-path=/tmp/chromedriver.log \ --verbose \ diff --git a/phpunit.xml b/phpunit.xml index 46e82e78d..bc0609fba 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -47,7 +47,7 @@ - + From 3e49f9d4adc66484fe3884927899fba913cc96b9 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 08:40:11 -0400 Subject: [PATCH 10/12] fix tests --- .../IntegerWeightTest.php | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/tests/src/FunctionalJavascript/IntegerWeightTest.php b/tests/src/FunctionalJavascript/IntegerWeightTest.php index 4f07be962..d9e18ef08 100644 --- a/tests/src/FunctionalJavascript/IntegerWeightTest.php +++ b/tests/src/FunctionalJavascript/IntegerWeightTest.php @@ -31,6 +31,7 @@ class IntegerWeightTest extends WebDriverTestBase { 'views', 'field_ui', 'integer_weight_test_views', + 'islandora', ]; /** @@ -83,24 +84,13 @@ class IntegerWeightTest extends WebDriverTestBase { */ public function setUp(): void { parent::setUp(); + $this->drupalCreateContentType([ + 'type' => 'repo_item', + 'name' => 'Repository Item', + ]); + + $this->drupalLogin($this->createUser(['edit any repo_item content'], 'test', TRUE)); - $this->adminUser = $this->drupalCreateUser( - [ - 'administer content types', - 'administer node fields', - 'administer node display', - ] - ); - - // Create dummy repo_item type to sort (since we don't have - // repository_object without islandora_defaults). - $type = $this->container->get('entity_type.manager')->getStorage('node_type') - ->create([ - 'type' => 'repo_item', - 'name' => 'Repository Item', - ]); - $type->save(); - $this->container->get('router.builder')->rebuild(); $fieldStorage = FieldStorageConfig::create([ 'field_name' => static::$fieldName, @@ -132,9 +122,11 @@ public function setUp(): void { * Test integer weight selector. */ public function testIntegerWeightSelector() { - $this->drupalGet('test-integer-weight'); - $page = $this->getSession()->getPage(); + $web_assert = $this->assertSession(); + $this->drupalGet('/test-integer-weight'); + $web_assert->pageTextContains('Item 1'); + $page = $this->getSession()->getPage(); $weight_select1 = $page->findField("field_integer_weight[0][weight]"); $weight_select2 = $page->findField("field_integer_weight[1][weight]"); $weight_select3 = $page->findField("field_integer_weight[2][weight]"); From 3ff078d2f0b14745b76aea4fe833689329ba33e2 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 08:43:57 -0400 Subject: [PATCH 11/12] lint --- tests/src/FunctionalJavascript/IntegerWeightTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/FunctionalJavascript/IntegerWeightTest.php b/tests/src/FunctionalJavascript/IntegerWeightTest.php index d9e18ef08..1cc19cbd9 100644 --- a/tests/src/FunctionalJavascript/IntegerWeightTest.php +++ b/tests/src/FunctionalJavascript/IntegerWeightTest.php @@ -89,8 +89,8 @@ public function setUp(): void { 'name' => 'Repository Item', ]); - $this->drupalLogin($this->createUser(['edit any repo_item content'], 'test', TRUE)); - + $account = $this->createUser(['edit any repo_item content'], 'test', TRUE); + $this->drupalLogin($account); $fieldStorage = FieldStorageConfig::create([ 'field_name' => static::$fieldName, From 238103c99dab6d554a044e09a7236f461ffae9b6 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Tue, 23 Apr 2024 09:04:37 -0400 Subject: [PATCH 12/12] Fix xpath for 10.3 --- tests/src/FunctionalJavascript/IntegerWeightTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/FunctionalJavascript/IntegerWeightTest.php b/tests/src/FunctionalJavascript/IntegerWeightTest.php index 1cc19cbd9..5e10133c4 100644 --- a/tests/src/FunctionalJavascript/IntegerWeightTest.php +++ b/tests/src/FunctionalJavascript/IntegerWeightTest.php @@ -146,8 +146,8 @@ public function testIntegerWeightSelector() { $this->assertSession()->pageTextNotContains('You have unsaved changes.'); // Drag and drop 'Item 1' over 'Item 2'. - $dragged = $this->xpath("//tr[@class='draggable'][1]//a[@class='tabledrag-handle']")[0]; - $target = $this->xpath("//tr[@class='draggable'][2]//a[@class='tabledrag-handle']")[0]; + $dragged = $this->xpath("//tr[contains(@class, 'draggable')][1]//a[contains(@class, 'tabledrag-handle')]")[0]; + $target = $this->xpath("//tr[contains(@class, 'draggable')][2]//a[contains(@class, 'tabledrag-handle')]")[0]; $dragged->dragTo($target); // Pause for javascript to do it's thing.