Skip to content

Commit 2150fe7

Browse files
author
Obada Haddad
committed
update tests
1 parent 4bb1571 commit 2150fe7

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ version: 2
33
jobs:
44
test:
55
machine:
6-
#image: ubuntu-2204:2024.01.2
76
image: ubuntu-2404:current
87
resource_class: large
98
steps:

playwrightPython/test_competition.py

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,21 @@ def test_manual_competition_creation(page: Page):
6363
page.get_by_role("link", name=" Benchmarks/Competitions").click()
6464
page.get_by_role("link", name=" Create").click()
6565
page.get_by_role("textbox").nth(1).click()
66-
page.get_by_role("textbox").nth(1).fill("Test")
66+
page.get_by_role("textbox").nth(1).fill("Test Title")
6767
with page.expect_file_chooser() as fc_info:
6868
page.get_by_role("button", name="").click()
6969
file_chooser = fc_info.value
7070
file_chooser.set_files("test_files/competition/test_logo.png")
7171
page.locator(".CodeMirror-scroll").first.click()
72-
page.get_by_role("application").get_by_role("textbox").fill("on")
72+
page.get_by_role("application").get_by_role("textbox").fill("Test Description ")
73+
page.get_by_role("textbox", name="Example: $1000 for the top").click()
74+
page.get_by_role("textbox", name="Example: $1000 for the top").fill("1000€")
75+
page.get_by_role("textbox", name="Example: email@example.com").click()
76+
page.get_by_role("textbox", name="Example: email@example.com").fill("organizer@email.com")
77+
page.get_by_text("Auto-run submissions").click()
78+
page.get_by_text("Enable Competition Forum").click()
79+
page.get_by_text("Make Programs Available").click()
80+
page.get_by_text("Make Input Data Available").click()
7381
page.get_by_role("textbox", name="Example: codalab/codalab-").click()
7482
page.get_by_role("textbox", name="Example: codalab/codalab-").fill("codalab/codalab-legacy:py37")
7583
page.get_by_text("Participation").click()
@@ -94,15 +102,22 @@ def test_manual_competition_creation(page: Page):
94102
page.locator("input[name=\"end_date\"]").click()
95103
page.locator("input[name=\"end_date\"]").fill("")
96104
page.locator("div:nth-child(7) > .EasyMDEContainer > .CodeMirror > .CodeMirror-scroll").click()
97-
page.locator(".CodeMirror.cm-s-easymde.CodeMirror-wrap.CodeMirror-focused > div > textarea").fill("Phase")
105+
page.locator(".CodeMirror.cm-s-easymde.CodeMirror-wrap.CodeMirror-focused > div > textarea").fill("This is a phase Test")
98106
page.locator(".ui.search.selection.dropdown.multiple").first.click()
99107
page.locator(".ui.search.selection.dropdown.multiple > .search").first.fill(str(titleNum) + "Playwright Task")
100108
page.get_by_text(str(titleNum) + "Playwright Task").nth(1).click()
109+
page.locator(".title > .dropdown").click()
110+
page.locator("input[name=\"execution_time_limit\"]").click()
111+
page.locator("input[name=\"execution_time_limit\"]").fill("100")
112+
page.locator("input[name=\"max_submissions_per_day\"]").click()
113+
page.locator("input[name=\"max_submissions_per_day\"]").fill("2")
114+
page.locator("input[name=\"max_submissions_per_person\"]").click()
115+
page.locator("input[name=\"max_submissions_per_person\"]").fill("3")
101116
page.get_by_text("Save").nth(3).click()
102117
page.get_by_text("Leaderboard", exact=True).click()
103118
page.get_by_role("button", name=" Add leaderboard").click()
104119
page.locator("input[name=\"title\"]").click()
105-
page.locator("input[name=\"title\"]").fill("Test title LEaderboard")
120+
page.locator("input[name=\"title\"]").fill("Test title Leaderboard")
106121
page.locator("input[name=\"key\"]").click()
107122
page.locator("input[name=\"key\"]").fill("Test Key")
108123
page.locator(".ui.plus").click()
@@ -114,7 +129,16 @@ def test_manual_competition_creation(page: Page):
114129
page.locator("input[name=\"column_key_0\"]").click()
115130
page.get_by_text("Save").nth(4).click()
116131
page.get_by_role("button", name="Save").click()
117-
expect(page.get_by_text("Test", exact=True)).to_be_visible()
118132
expect(page.get_by_text("Test Content")).to_be_visible()
119-
120-
# TODO Verify a few more items from the created competition
133+
expect(page.locator(".reward-container")).to_be_visible()
134+
expect(page.get_by_text("1000€")).to_be_visible()
135+
page.get_by_text("Terms", exact=True).click()
136+
expect(page.get_by_text("Test Terms")).to_be_visible()
137+
page.get_by_text("Phases").click()
138+
expect(page.locator("comp-tabs")).to_contain_text(str(titleNum) + "Playwright Task")
139+
expect(page.get_by_text("This is a phase Test")).to_be_visible()
140+
page.get_by_text("My Submissions").click()
141+
expect(page.get_by_text("out of 2")).to_be_visible()
142+
expect(page.get_by_text("out of 3")).to_be_visible()
143+
page.get_by_role("link", name="Forum").click()
144+
expect(page.get_by_role("heading", name="Test Title Forum")).to_be_visible()

playwrightPython/test_submission.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def test_submission_v2_multiTaskFactSheet(page: Page) -> None:
164164
expect(page.locator('.ui.indicating')).not_to_be_visible()
165165
# Reload the page until the finished status is visible or the count is reached
166166
count = 0
167-
while not wait_for_finished(page, 5000) and count < 5:
167+
while not wait_for_finished(page, 10000) and count < 5:
168168
page.reload()
169169
count += 1
170170
expect(page.get_by_role("cell", name="Finished")).to_be_visible(timeout=1)
@@ -188,7 +188,7 @@ def test_submission_v2_multiTask(page: Page) -> None:
188188
expect(page.locator('.ui.indicating')).not_to_be_visible()
189189
# Reload the page until the finished status is visible or the count is reached
190190
count = 0
191-
while not wait_for_finished(page, 5000) and count < 5:
191+
while not wait_for_finished(page, 10000) and count < 5:
192192
page.reload()
193193
count += 1
194194
expect(page.get_by_role("cell", name="Finished")).to_be_visible(timeout=1)

0 commit comments

Comments
 (0)