mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-11-10 05:34:44 +00:00
comment appTestHelpers.js
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
3b1b0cfd57
commit
72e2f0fa03
@ -1,5 +1,10 @@
|
||||
import {strict as assert} from "node:assert";
|
||||
|
||||
/**
|
||||
* Fills out a create or update review form
|
||||
* @param {Object} page the page object which contains the create or update form
|
||||
* @param {Object} review review data to input into the form
|
||||
*/
|
||||
export async function setReviewForm(page, review) {
|
||||
|
||||
// Set text fields
|
||||
@ -28,6 +33,12 @@ export async function setReviewForm(page, review) {
|
||||
await rating_select.click({delay: 100});
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a page or shadowDOM for correct element text, src, or alt values
|
||||
* @param {Object} root page or shodowDOM to test
|
||||
* @param {string} prefix prefix character for element IDs
|
||||
* @param {Object} expected values for eahc element
|
||||
*/
|
||||
export async function checkCorrectness(root, prefix, expected){
|
||||
// Get the review image and check src and alt
|
||||
let img = await root.$(`#${prefix}-mealImg`);
|
||||
|
Loading…
Reference in New Issue
Block a user