-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from notoraptor/web-user-prop-dicts-in
Dictionnaires job-utilisateur visibles dans l'interface web
- Loading branch information
Showing
14 changed files
with
556 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -640,6 +640,59 @@ def test_filter_by_job_array(page: Page): | |
_check_jobs_table(page, JOBS_SEARCH_DEFAULT_TABLE) | ||
|
||
|
||
def test_filter_by_job_user_props(page: Page): | ||
# Login | ||
page.goto(f"{BASE_URL}/login/[email protected]") | ||
# Go to settings. | ||
page.goto(f"{BASE_URL}/settings/") | ||
radio_job_user_props = page.locator("input#jobs_list_job_user_props_toggle") | ||
expect(radio_job_user_props).to_be_checked(checked=False) | ||
# Check column job_user_props. | ||
radio_job_user_props.click() | ||
expect(radio_job_user_props).to_be_checked(checked=True) | ||
# Back to jobs/search. | ||
page.goto(f"{BASE_URL}/jobs/search") | ||
|
||
job_id = page.get_by_text("795002") | ||
expect(job_id).to_have_count(1) | ||
parent_row = page.locator("table#search_table tbody tr").filter(has=job_id) | ||
expect(parent_row).to_have_count(1) | ||
cols = parent_row.locator("td") | ||
link_job_user_prop = cols.nth(4).locator("a") | ||
expect(link_job_user_prop).to_have_count(1) | ||
expect(link_job_user_prop).to_contain_text("name je suis une user prop 1") | ||
link_job_user_prop.click() | ||
expect(page).to_have_url( | ||
f"{BASE_URL}/jobs/search?" | ||
f"user_prop_name=name" | ||
f"&user_prop_content=je+suis+une+user+prop+1" | ||
f"&page_num=1" | ||
) | ||
_check_jobs_table( | ||
page, | ||
[ | ||
["mila", "student06 @mila.quebec", "795002"], | ||
["graham", "student12 @mila.quebec", "613024"], | ||
], | ||
) | ||
|
||
filter_reset = page.get_by_title("Reset filter by job user prop") | ||
expect(filter_reset).to_contain_text('User prop name: "je suis une user prop 1"') | ||
filter_reset.click() | ||
|
||
expect(page).to_have_url( | ||
f"{BASE_URL}/jobs/search?user_prop_name=&user_prop_content=&page_num=1" | ||
) | ||
_check_jobs_table(page, JOBS_SEARCH_DEFAULT_TABLE) | ||
|
||
# Back to default settings. | ||
page.goto(f"{BASE_URL}/settings/") | ||
radio_job_user_props = page.locator("input#jobs_list_job_user_props_toggle") | ||
expect(radio_job_user_props).to_be_checked(checked=True) | ||
radio_job_user_props.click() | ||
expect(radio_job_user_props).to_be_checked(checked=False) | ||
|
||
|
||
def test_jobs_table_sorting_by_cluster(page: Page): | ||
_load_jobs_search_page(page) | ||
expected_content = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,3 +223,66 @@ def test_jobs_search_columns(page: Page): | |
expect(headers.nth(7)).to_contain_text("Start time") | ||
expect(headers.nth(8)).to_contain_text("End time") | ||
expect(headers.nth(9)).to_contain_text("Links") | ||
|
||
|
||
def test_jobs_search_column_job_user_props(page: Page): | ||
# Login | ||
page.goto(f"{BASE_URL}/login/[email protected]") | ||
# Check default jobs search columns. | ||
page.goto(f"{BASE_URL}/jobs/search") | ||
headers = page.locator("table#search_table thead tr th") | ||
expect(headers).to_have_count(10) | ||
expect(headers.nth(0)).to_contain_text("Cluster") | ||
expect(headers.nth(1)).to_contain_text("User (@mila.quebec)") | ||
expect(headers.nth(2)).to_contain_text("Job ID") | ||
expect(headers.nth(3)).to_contain_text("Job array") | ||
expect(headers.nth(4)).to_contain_text("Job name [:20]") | ||
expect(headers.nth(5)).to_contain_text("Job state") | ||
expect(headers.nth(6)).to_contain_text("Submit time") | ||
expect(headers.nth(7)).to_contain_text("Start time") | ||
expect(headers.nth(8)).to_contain_text("End time") | ||
expect(headers.nth(9)).to_contain_text("Links") | ||
|
||
# Go to settings. | ||
page.goto(f"{BASE_URL}/settings/") | ||
radio_job_user_props = page.locator("input#jobs_list_job_user_props_toggle") | ||
expect(radio_job_user_props).to_be_checked(checked=False) | ||
# Check column job_user_props. | ||
radio_job_user_props.click() | ||
expect(radio_job_user_props).to_be_checked(checked=True) | ||
|
||
# Check column job_user_props is indeed now displayed in jobs/search. | ||
page.goto(f"{BASE_URL}/jobs/search") | ||
headers = page.locator("table#search_table thead tr th") | ||
expect(headers).to_have_count(11) | ||
expect(headers.nth(0)).to_contain_text("Cluster") | ||
expect(headers.nth(1)).to_contain_text("User (@mila.quebec)") | ||
expect(headers.nth(2)).to_contain_text("Job ID") | ||
expect(headers.nth(3)).to_contain_text("Job array") | ||
expect(headers.nth(4)).to_contain_text("Job-user props") | ||
expect(headers.nth(5)).to_contain_text("Job name [:20]") | ||
expect(headers.nth(6)).to_contain_text("Job state") | ||
expect(headers.nth(7)).to_contain_text("Submit time") | ||
expect(headers.nth(8)).to_contain_text("Start time") | ||
expect(headers.nth(9)).to_contain_text("End time") | ||
expect(headers.nth(10)).to_contain_text("Links") | ||
|
||
# Back to default settings. | ||
page.goto(f"{BASE_URL}/settings/") | ||
radio_job_user_props = page.locator("input#jobs_list_job_user_props_toggle") | ||
expect(radio_job_user_props).to_be_checked(checked=True) | ||
radio_job_user_props.click() | ||
expect(radio_job_user_props).to_be_checked(checked=False) | ||
page.goto(f"{BASE_URL}/jobs/search") | ||
headers = page.locator("table#search_table thead tr th") | ||
expect(headers).to_have_count(10) | ||
expect(headers.nth(0)).to_contain_text("Cluster") | ||
expect(headers.nth(1)).to_contain_text("User (@mila.quebec)") | ||
expect(headers.nth(2)).to_contain_text("Job ID") | ||
expect(headers.nth(3)).to_contain_text("Job array") | ||
expect(headers.nth(4)).to_contain_text("Job name [:20]") | ||
expect(headers.nth(5)).to_contain_text("Job state") | ||
expect(headers.nth(6)).to_contain_text("Submit time") | ||
expect(headers.nth(7)).to_contain_text("Start time") | ||
expect(headers.nth(8)).to_contain_text("End time") | ||
expect(headers.nth(9)).to_contain_text("Links") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.