Skip to content

Commit 806fc78

Browse files
committed
Fix button selector for Lightning app e2e tests
Changes to the Lightning platform UI caused the e2e tests to break because button text on the project creation dialog was changed. This fixes the selector.
1 parent 9301a6b commit 806fc78

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/lightning_app/testing/testing.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,20 @@ def run_app_in_cloud(app_folder: str, app_name: str = "app.py") -> Generator:
247247
[LIGHTNING_CLOUD_PROJECT_ID],
248248
)
249249
admin_page.goto(f"{Config.url}/{Config.username}/apps")
250+
251+
# Closing the Create Project dialog.
250252
try:
251-
# Closing the Create Project modal
252-
button = admin_page.locator('button:has-text("Cancel")')
253+
project_dialog = admin_page.locator('text=Create a project')
254+
project_dialog.wait_for(timeout=10 * 1000, state="visible")
255+
print("'Create Project' dialog visible, closing it.")
256+
project_name_input = admin_page.locator('input[type="text"]')
257+
project_name_input.fill("Default Project")
258+
button = admin_page.locator('button:has-text("Continue")')
253259
button.wait_for(timeout=3 * 1000)
254260
button.click()
255-
except (playwright._impl._api_types.Error, playwright._impl._api_types.TimeoutError):
256-
pass
261+
except playwright._impl._api_types.TimeoutError:
262+
print("'Create Project' dialog not visible, skipping.")
263+
257264
admin_page.locator(f"text={name}").click()
258265
admin_page.evaluate(
259266
"""data => {

0 commit comments

Comments
 (0)