JSFiddle - React, Tailwind, and code Playground

by JeffC

JavaScript

// TODOs

// add the URL verifications from the BBImageTest script

// write the script that creates the html file that displays the images... one row per product
// can TC write to a file?

// add the ability to check all pages of the related products

// add a script that checks the favorites

// verify the price and quantity throughout the shopping/check out process

// verify the home page

// verify order status

// verify My Account page

// verify the filter functionality... go to a gallery page, click one of the Narrow Your Search links... verify that the # of products on the page is equal to the number beside the color, style, type, etc. links listed

// verify Compare functionality

// verify the number of pages is correct for the number of products displayed

// verify image changes on clicking color swatches (verify image URL changes)

// TRY THIS
// var e = document.getElementById(); on an id that doesn't exist... see if TC throws an error.
// if not, see if e.length === 0;
// if this works, i may be able to remove the WebPageObject.Find() in WaitForElement()



// write a function that navigates to the shopping cart and deletes all products
function RemoveAllItemsFromCart()
{
    // navigate to cart URL
    // https://uat.iprint.com/estore/en/checkout/shoppingCart.jsp
    
    // while "delete" link exists on page... click it, confirm delete, and wait for page to reload
    var e = document.getElementsByClassName("manage-cartitem-links");
    while (e.length > 0)
    {
        e[0].getElementsByTagName("a")[1].click();

        // wait for confirmation dialog to popup
        e = document.getElementById("deleteCartItem").getElementsByClassName("btn-primary margin-right-10px")[0].click();
        
        // wait for page to reload
        // not sure what to do here... reload page object? may not work since it's the same URL
        
        // click the Yes link to confirm
        e =...