Skip to content

Commit b56f31e

Browse files
committed
Apache Superset: Adapt software tests for Superset 6
1 parent 5913aeb commit b56f31e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

application/apache-superset/test.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import requests
2-
from playwright.sync_api import sync_playwright
2+
from playwright.sync_api import expect, sync_playwright
33

44
from util import get_auth_headers
55

@@ -62,29 +62,29 @@ def test_ui():
6262
# Navigate to Apache Superset.
6363
page = browser.new_page()
6464
page.goto(uri_home)
65+
page.wait_for_url("**/login/")
6566

6667
# Run the login procedure.
67-
assert page.text_content(".panel-title") == "Sign In"
68-
assert page.url.endswith("/login/")
6968
page.type("input#username", "admin")
7069
page.type("input#password", "admin")
71-
page.click("input[type=submit]")
70+
page.click("[type=submit]")
71+
page.wait_for_load_state()
7272

73-
# Verify login was successful, and being navigated to `Home`.
74-
html_title = page.text_content("title").strip()
75-
assert html_title == "Superset"
76-
assert page.url.endswith("/superset/welcome/")
77-
78-
# Invoke SQL Lab with an example query, and verify response.
79-
sql = "SELECT * FROM sys.summits LIMIT 42;"
73+
# Navigate to SQL Lab.
8074
page.goto(uri_sqllab)
75+
page.wait_for_load_state()
76+
77+
# Invoke query on SQL Lab.
78+
sql = "SELECT region, mountain, height FROM sys.summits LIMIT 42;"
8179
page.wait_for_selector("#ace-editor")
8280
page.evaluate(f"ace.edit('ace-editor').setValue('{sql}')")
8381
page.get_by_role("button", name="Run").click()
84-
page.wait_for_timeout(500)
85-
page_body = page.text_content("div.ant-tabs-content-holder")
86-
assert "42 rows" in page_body
87-
assert "Monte Rosa" in page_body
82+
page.wait_for_load_state()
83+
84+
# Verify SQL Lab response.
85+
locator = page.locator("body")
86+
# expect(locator).to_contain_text("42 rows")
87+
expect(locator).to_contain_text("Monte Rosa")
8888

8989
# That's it.
9090
browser.close()

0 commit comments

Comments
 (0)