Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as JavaScript by Mish ( 8 years ago )
validateData() {

        element(by.className('page-number-total')).getText().then(function (pages) {
            console.log("Total Pages: " + pages);
            return parseInt(pages);
        }).then(function (totalPages) {
                generalModule.anchorScroll(totalPages);
                let totalItems = element.all(by.css("div.imgdatalist > div.imgdatalist-item"));
                totalItems.count().then(function (totalList) {
                    console.log("Total Listings Displayed: " + totalList);
                    browser.sleep(3000);
                    for (let i = 0; i < totalList> a")).getText().then(function (category) {
                         console.log("Category & Sub Category: " + category);
                         expect(category.toString()).toContain("Furniture" + "," + "Case Pieces" + "," + "Chests & Commodes");
                         });

                         //Validate Listing Title
                         element.all(by.css("h1")).getText().then(function (title) {
                         console.log("Title: " + title);
                         expect(title.toString()).toEqual("Early and Rare Kurt Versen Pendant Fixture");
                         });

                         //Validate Artist
                         element.all(by.id("ArtistNameId")).getText().then(function (artist) {
                         if (artist.toString() === "") {
                         console.log("**********NO ARTIST ENTERED**********");
                         } else {
                         console.log("Artist: " + artist);
                         expect(artist.toString()).toEqual('Abbondinterni');
                         }
                         });

                         //Validate Customizable
                         element.all(by.id("customizable_field")).getText().then(function (customizable) {
                         if (customizable.toString() === "") {
                         console.log("**********NO CUSTOMIZATION ENTERED**********");
                         } else {
                         console.log("Customization: " + customizable);
                         expect(customizable.toString()).toEqual('Test');
                         }
                         });

                         //Validate Origin
                         element.all(by.id("region_info_field")).getText().then(function (origin) {
                         if (origin.toString() === "") {
                         console.log("**********NO ORIGIN ENTERED**********");
                         } else {
                         console.log("Origin: " + origin);
                         expect(origin.toString()).toEqual('United States, Pennsylvania');
                         }
                         });

                         //Validate Period
                         element.all(by.id("period_name_field")).getText().then(function (period) {
                         if (period.toString() === "") {
                         console.log("**********NO PERIOD ENTERED**********");
                         } else {
                         console.log("Period: " + period);
                         expect(period.toString()).toEqual('18th Century');
                         }
                         });

                         //Validate Materials
                         element.all(by.id("material_techniques_field")).getText().then(function (materials) {
                         if (materials.toString() === "") {
                         console.log("**********NO MATERIALS ENTERED**********");
                         } else {
                         console.log("Materials: " + materials);
                         expect(materials.toString()).toEqual('Test Materials');
                         }
                         });

                         //Validate Dimensions in Inches
                         element.all(by.id("width_in_field")).getText().then(function (widthInField) {
                         console.log("W in: " + widthInField);
                         expect(widthInField.toString()).toEqual('36 in;');
                         });
                         element.all(by.id("height_in_field")).getText().then(function (heightInField) {
                         console.log("H in: " + heightInField);
                         expect(heightInField.toString()).toEqual('33.5 in;');
                         });
                         element.all(by.id("depth_in_field")).getText().then(function (depthInField) {
                         console.log("DH in: " + depthInField);
                         expect(depthInField.toString()).toEqual('20 in;');
                         });

                         //Validate Dimensions in Centimeters
                         element.all(by.id("width_cm_field")).getText().then(function (widthCmField){
                         console.log("W cm: " + widthCmField);
                         expect(widthCmField.toString()).toEqual('91.44 cm;');
                         });
                         element.all(by.id("height_cm_field")).getText().then(function (heightCmField){
                         console.log("H cm: " + heightCmField);
                         expect(heightCmField.toString()).toEqual('85.09 cm;');
                         });
                         element.all(by.id("depth_cm_field")).getText().then(function (depthCmField){
                         console.log("DH cm: " + depthCmField);
                         expect(depthCmField.toString()).toEqual('50.8 cm;');
                         });

                         //Validate Condition
                         element.all(by.id("condition_field")).getText().then(function (condition) {
                         if (condition.toString() === "") {
                         console.log("**********NO CONDITION ENTERED**********");
                         } else {
                         console.log("Condition: " + condition);
                         expect(condition.toString()).toEqual('Fair. Test');
                         }
                         });

                         //Validate Creation Date
                         element.all(by.id("creation_date_field")).getText().then(function (createDate) {
                         if (createDate.toString() === "") {
                         console.log("**********NO CREATION DATE ENTERED**********");
                         } else {
                         console.log("Creation Date: " + createDate);
                         expect(createDate.toString()).toEqual('1770s');
                         }
                         });

                         //Validate Number of Pieces
                         element.all(by.id("pieces_number_field")).getText().then(function (numPieces) {
                         if (numPieces.toString() === "") {
                         console.log("**********NO NUMBER OF PIECES ENTERED**********");
                         } else {
                         console.log("Number of Pieces: " + numPieces);
                         expect(numPieces.toString()).toEqual('2-3');
                         }
                         });

                         //Validate Description
                         element.all(by.id("description_field")).getText().then(function (description) {
                         if (description.toString() === "") {
                         console.log("**********NO DESCRIPTION ENTERED**********");
                         } else {
                         console.log("Description: " + description);
                         expect(description.toString()).toEqual('Walnut chippendale four drawer low chest with bale and rosette brasses fluted corner columns terminating in ogee feet with a excellent patina');
                         }
                         });

                         //Validate Styles & Movements
                         element.all(by.id("styles_field")).getText().then(function (styleMovement) {
                         if (styleMovement.toString() === "") {
                         console.log("**********NO STYLE & MOVEMENT ENTERED**********");
                         } else {
                         console.log("Styles & Movements: " + styleMovement);
                         expect(styleMovement.toString()).toEqual('Chippendale');
                         }
                         });

                         //Validate Dealer Reference Number
                         element.all(by.id("inventory_code_field")).getText().then(function (inventoryCode) {
                         if (inventoryCode.toString() === "") {
                         console.log("**********NO DEALER REFERENCE NUMBER ENTERED**********");
                         } else {
                         console.log("Dealer Reference Number: " + inventoryCode);
                         expect(inventoryCode.toString()).toEqual('123456');
                         }
                         });

                         //Validate Incollect Reference Number
                         element.all(by.id("ref_num_field")).getText().then(function (ref_num_field) {
                         if (ref_num_field.toString() === "") {
                         console.log("**********NO INCOLLECT REFERENCE NUMBER ENTERED**********");
                         } else {
                         console.log("Incollect Reference Number: " + ref_num_field);
                         expect(ref_num_field.toString()).toEqual('178339');
                         }
                         });
                         */
                        browser.sleep(5000);
                        generalModule.switchMainWindow();
                        browser.driver.executeScript('window.focus();');
                    }
                });
            }
        );
    }

 

Revise this Paste

Parent: 90232
Your Name: Code Language: