Skip to content

Commit e5e064f

Browse files
authored
Merge pull request galaxyproject#22157 from jmchilton/tool_form_harness
Add test suite for running tool tests via Playwright using the tool form
2 parents b7c8e1f + 0156639 commit e5e064f

File tree

8 files changed

+782
-4
lines changed

8 files changed

+782
-4
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Tool form harness tests
2+
on:
3+
push:
4+
paths:
5+
- 'client/src/components/Form/**'
6+
- 'client/src/components/Tool/**'
7+
- 'client/src/utils/navigation/navigation.yml'
8+
- 'lib/galaxy/navigation/navigation.yml'
9+
- 'lib/galaxy/selenium/navigates_galaxy.py'
10+
- 'lib/galaxy_test/selenium/framework.py'
11+
- 'lib/galaxy_test/selenium/test_tool_form_harness.py'
12+
- 'test/functional/tools/**'
13+
- '.github/workflows/tool_form_harness.yaml'
14+
pull_request:
15+
paths:
16+
- 'client/src/components/Form/**'
17+
- 'client/src/components/Tool/**'
18+
- 'client/src/utils/navigation/navigation.yml'
19+
- 'lib/galaxy/navigation/navigation.yml'
20+
- 'lib/galaxy/selenium/navigates_galaxy.py'
21+
- 'lib/galaxy_test/selenium/framework.py'
22+
- 'lib/galaxy_test/selenium/test_tool_form_harness.py'
23+
- 'test/functional/tools/**'
24+
- '.github/workflows/tool_form_harness.yaml'
25+
schedule:
26+
# Run at midnight UTC every Tuesday
27+
- cron: '0 0 * * 2'
28+
env:
29+
GALAXY_CONFIG_GALAXY_URL_PREFIX: '/galaxypf'
30+
GALAXY_TEST_E2E_TOOL_TESTS: '1'
31+
GALAXY_TEST_DBURI: 'postgresql://postgres:postgres@localhost:5432/galaxy?client_encoding=utf8'
32+
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
33+
GALAXY_TEST_SELENIUM_RETRIES: 1
34+
GALAXY_TEST_SKIP_FLAKEY_TESTS_ON_ERROR: 1
35+
GALAXY_TEST_SELENIUM_HEADLESS: 1
36+
YARN_INSTALL_OPTS: --frozen-lockfile
37+
GALAXY_CONFIG_SQLALCHEMY_WARN_20: '1'
38+
concurrency:
39+
group: ${{ github.workflow }}-${{ github.ref }}
40+
cancel-in-progress: true
41+
jobs:
42+
build-client:
43+
uses: ./.github/workflows/build_client.yaml
44+
test:
45+
name: Test
46+
needs: [build-client]
47+
runs-on: ubuntu-latest
48+
strategy:
49+
fail-fast: false
50+
matrix:
51+
python-version: ['3.10']
52+
services:
53+
postgres:
54+
image: postgres:17
55+
env:
56+
POSTGRES_USER: postgres
57+
POSTGRES_PASSWORD: postgres
58+
POSTGRES_DB: postgres
59+
ports:
60+
- 5432:5432
61+
steps:
62+
- if: github.event_name == 'schedule'
63+
run: |
64+
echo "GALAXY_CONFIG_OVERRIDE_METADATA_STRATEGY=extended" >> $GITHUB_ENV
65+
echo "GALAXY_CONFIG_OVERRIDE_OUTPUTS_TO_WORKING_DIRECTORY=true" >> $GITHUB_ENV
66+
- uses: actions/checkout@v6
67+
with:
68+
path: 'galaxy root'
69+
persist-credentials: false
70+
- uses: actions/setup-python@v6
71+
with:
72+
python-version: ${{ matrix.python-version }}
73+
- name: Install uv
74+
uses: astral-sh/setup-uv@v7
75+
- name: Get full Python version
76+
id: full-python-version
77+
shell: bash
78+
run: echo "version=$(python -c 'import sys; print("-".join(str(v) for v in sys.version_info))')" >> $GITHUB_OUTPUT
79+
- name: Cache galaxy venv
80+
uses: actions/cache@v5
81+
with:
82+
path: 'galaxy root/.venv'
83+
key: gxy-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-playwright
84+
- name: Install dependencies
85+
run: ./scripts/common_startup.sh --dev-wheels --skip-client-build
86+
working-directory: 'galaxy root'
87+
- name: Install Playwright
88+
run: |
89+
. .venv/bin/activate
90+
playwright install chromium --with-deps
91+
working-directory: 'galaxy root'
92+
- name: Restore client cache
93+
uses: actions/cache@v5
94+
with:
95+
fail-on-cache-miss: true
96+
key: galaxy-static-${{ needs.build-client.outputs.commit-id }}
97+
path: 'galaxy root/static'
98+
- name: Run tests
99+
run: ./run_tests.sh --coverage -playwright lib/galaxy_test/selenium/test_tool_form_harness.py
100+
working-directory: 'galaxy root'
101+
- uses: codecov/codecov-action@v5
102+
with:
103+
flags: tool-form-harness
104+
working-directory: 'galaxy root'
105+
- uses: actions/upload-artifact@v7
106+
if: failure()
107+
with:
108+
name: Tool form harness test results (${{ matrix.python-version }})
109+
path: 'galaxy root/run_playwright_tests.html'
110+
- uses: actions/upload-artifact@v7
111+
if: failure()
112+
with:
113+
name: Tool form harness debug info (${{ matrix.python-version }})
114+
path: 'galaxy root/database/test_errors'

client/src/utils/navigation/navigation.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,17 @@ tool_form:
669669
parameter_data_label: 'div.ui-form-element[id="form-element-${parameter}"] [data-description="form data label"]'
670670
parameter_data_select: 'div.ui-form-element[id="form-element-${parameter}"] .multiselect'
671671

672+
parameter_checkbox_input: 'div.ui-form-element[id="form-element-${parameter}"] input[type="checkbox"]'
673+
parameter_color_input: 'div.ui-form-element[id="form-element-${parameter}"] input[type="color"]'
674+
parameter_text_input: 'div.ui-form-element[id="form-element-${parameter}"] input'
675+
parameter_form_selection: 'div.ui-form-element[id="form-element-${parameter}"] .form-selection'
676+
parameter_multiselect_tag_close: 'div.ui-form-element[id="form-element-${parameter}"] i.multiselect__tag-icon'
677+
parameter_drilldown_option: 'div.ui-form-element[id="form-element-${parameter}"] #drilldown-option-${value}'
678+
672679
repeat_insert: '[data-description="repeat insert"]'
673680
repeat_move_up: '#${parameter}_up'
674681
repeat_move_down: '#${parameter}_down'
682+
section_header: '.ui-portlet-section .portlet-header'
675683
reference: '.formatted-reference'
676684
about: '.tool-footer'
677685
storage_options: '.tool-storage'

lib/galaxy/selenium/navigates_galaxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,14 +2184,14 @@ def tool_parameter_edit_rules(self):
21842184
edit_button_element = rules_div_element.find_element(By.CSS_SELECTOR, ".form-rules-edit button")
21852185
edit_button_element.click()
21862186

2187-
def tool_set_value(self, expanded_parameter_id, value, expected_type=None):
2187+
def tool_set_value(self, expanded_parameter_id, value, expected_type=None, multiple=False):
21882188
div_element = self.tool_parameter_div(expanded_parameter_id)
21892189
assert div_element
21902190
if expected_type in ["select", "data", "data_collection"]:
21912191
select_field = self.components.tool_form.parameter_data_select(
21922192
parameter=expanded_parameter_id
21932193
).wait_for_visible()
2194-
self.select_set_value(select_field, value)
2194+
self.select_set_value(select_field, value, multiple=multiple)
21952195
else:
21962196
input_element = div_element.find_element(By.CSS_SELECTOR, "input")
21972197
# Clear default value

0 commit comments

Comments
 (0)