async def test_short_answer_1(selenium_utils_user_1, bookserver_session): id = "test_short_answer_1" # The first test doesn't click the submit button. db = bookserver_session expr = select(ShortanswerAnswers).where(ShortanswerAnswers.div_id == id) test_shortanswer.test_sa1(selenium_utils_user_1) s = await get_answer(db, expr, 0) # The second test clicks submit with no text. test_shortanswer.test_sa2(selenium_utils_user_1) s = await get_answer(db, expr, 1) assert s[0].answer == "" # The third test types text then submits it. test_shortanswer.test_sa3(selenium_utils_user_1) s = await get_answer(db, expr, 2) assert s[1].answer == "My answer" # The fourth test is just a duplicate of the third test. test_shortanswer.test_sa4(selenium_utils_user_1) s = await get_answer(db, expr, 3) assert s[2].answer == "My answer"
def test_short_answer_1(selenium_utils_user_1, runestone_db): id = "test_short_answer_1" # The first test doesn't click the submit button. db = runestone_db expr = db.shortanswer_answers.div_id == id test_shortanswer.test_sa1(selenium_utils_user_1) s = get_answer(db, expr, 0) # The second test clicks submit with no text. test_shortanswer.test_sa2(selenium_utils_user_1) s = get_answer(db, expr, 1) assert s[0].answer == "" # The third test types text then submits it. test_shortanswer.test_sa3(selenium_utils_user_1) s = get_answer(db, expr, 2) assert s[1].answer == "My answer" # The fourth test is just a duplicate of the third test. test_shortanswer.test_sa4(selenium_utils_user_1) s = get_answer(db, expr, 3) assert s[2].answer == "My answer"