BUG352-NEIL2 #59

Merged
mrlan merged 16 commits from BUG352-NEIL2 into Hui-Organize 2024-01-08 18:25:01 +08:00
Collaborator

hello sir check my request

hello sir check my request
neil added 3 commits 2023-12-06 10:12:46 +08:00
neil added 1 commit 2023-12-06 10:24:06 +08:00
neil added 1 commit 2023-12-06 10:38:59 +08:00
mrlan added 6 commits 2023-12-12 20:23:55 +08:00

@neil

Thanks.

I verified your bug fix and it works.

In addition, I made a few commits on your branch.

TODO

  • Could you make LRR stay on the same Tab, i.e., "Create instructor account", after clicking the Create button?

Hui

@neil Thanks. I verified your bug fix and it works. In addition, I made a few commits on your branch. TODO - Could you make LRR stay on the same Tab, i.e., "Create instructor account", after clicking the Create button? Hui
neil added 1 commit 2023-12-19 22:04:58 +08:00
neil added 1 commit 2023-12-22 22:00:12 +08:00
f3f7e0ccfd Update test case script with improvements
- Introduce pytest framework to consolidate test cases into a single file.
- Directly test the login functionality for newly created Teaching Assistants (TA's).
neil added 1 commit 2023-12-22 22:06:32 +08:00

@neil

Thanks for the new video. It looks and sounds great.

I also notice that you have kept the same Tab. That's great.

Hui

@neil Thanks for the new video. It looks and sounds great. I also notice that you have kept the same Tab. That's great. Hui
mrlan reviewed 2023-12-23 16:12:38 +08:00
@ -0,0 +6,4 @@
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@pytest.mark.generate_password_1

@neil

Why have @pytest.mark.generate_password_1 necessary? Likewise for @pytest.mark.generate_password_2.

It seems that this decorator causes PytestUnknownMarkWarning on the console.

@neil Why have `@pytest.mark.generate_password_1 necessary`? Likewise for `@pytest.mark.generate_password_2`. It seems that this decorator causes `PytestUnknownMarkWarning` on the console.
neil marked this conversation as resolved
mrlan reviewed 2023-12-23 16:13:37 +08:00
@ -0,0 +21,4 @@
login_button = driver_open.find_element('id', "login_btn")
# login as a TA

@neil

The comment should be # login as a Lecturer.

@neil The comment should be `# login as a Lecturer`.
neil marked this conversation as resolved
mrlan reviewed 2023-12-23 16:14:57 +08:00
@ -0,0 +28,4 @@
login_button.click()
admin_tab = driver_open.find_element('id', 'admin_tab')
admin_tab.click()
print("login sucessfully")

@neil

The print statement actually has no effect. It won't print things on console.

@neil The `print` statement actually has no effect. It won't print things on console.
neil marked this conversation as resolved
mrlan reviewed 2023-12-23 16:16:30 +08:00
@ -0,0 +38,4 @@
def createTA(driver, TA_name, emails, password):
full_name = driver.find_element('name', 'fullname')
full_name.send_keys(TA_name)
email= driver.find_element('name', 'email')

@neil

There should be a whitespace before the operator =.

Make sure that there is a whitespace before and after = in each assignment statement.

@neil There should be a whitespace before the operator `=`. Make sure that there is a whitespace before and after `=` in each assignment statement.
neil marked this conversation as resolved
mrlan reviewed 2023-12-23 16:18:01 +08:00
@ -0,0 +35,4 @@
t = time.localtime()
current_time = time.strftime("%H:%M:%S", t)
time.sleep(25)
def createTA(driver, TA_name, emails, password):

@neil

Why not move this helper function createTA() out of test_createTA()?

Also, probably it is a good idea to create a helper function for logging in, to avoid code duplication.

@neil Why not move this helper function `createTA()` out of `test_createTA()`? Also, probably it is a good idea to create a helper function for logging in, to avoid code duplication.
neil marked this conversation as resolved
mrlan reviewed 2023-12-23 16:20:18 +08:00
@ -0,0 +45,4 @@
usr_type=driver.find_element('name', 'type')
usr_type.click()
click_create =driver.find_element('name', 'create_btn')
click_create.click()

@neil

Please sleep for 3 seconds before clicking the Create button.

@neil Please sleep for 3 seconds before clicking the Create button.
neil marked this conversation as resolved
mrlan reviewed 2023-12-23 16:21:49 +08:00
@ -0,0 +93,4 @@
else:
driver_open.quit()
try:
with open('TEST_CREATING_TA.txt', 'a') as test_output:

@neil
Do we still need to write to a file?

@neil Do we still need to write to a file?
neil marked this conversation as resolved
mrlan reviewed 2023-12-23 16:22:59 +08:00
@ -0,0 +116,4 @@
login_button = driver_open.find_element('id', "login_btn")
# login as a TA

# login as a Lecturer

`# login as a Lecturer`
neil marked this conversation as resolved
mrlan reviewed 2023-12-23 16:25:38 +08:00
@ -0,0 +1,205 @@
import re

@neil

Did not test the undesirable case that the Lecturer tries to create an existing TA account.

Please add a test function called test_create_an_existing_TA_account().

@neil Did not test the undesirable case that the Lecturer tries to create an existing TA account. Please add a test function called `test_create_an_existing_TA_account()`.
neil marked this conversation as resolved
neil added 1 commit 2023-12-28 05:29:37 +08:00
a87c741c13 Update test case script with improvements
- Removing unused statement.
- Testing already existing accounts.
neil added 1 commit 2023-12-28 05:45:50 +08:00
Poster
Collaborator

https://share.weiyun.com/I6ojWg0E this is the updated video link.

https://share.weiyun.com/I6ojWg0E this is the updated video link.
mrlan merged commit 44a7d4533e into Hui-Organize 2024-01-08 18:25:01 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrlan/LRR#59
There is no content yet.