Expect

From UBot Studio
Revision as of 15:24, 4 October 2016 by LillyT (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This command is a Unit Testing command in the UBot Studio Extended Library.

This command sets a condition that the It command should meet in order for the unit test to be successful.

Condition to Expect: The condition that should be met to indicate the success to the test.

The Expect command is placed inside the It command to check to see if the process ended with the desired result.

The UI log view command is added to allow the results of the test to appear on the UI.

Example

clear all data
ui log view("Unit Tests")
describe("UBot Playground Captcha") {
    it("Should check for captcha completion") {
        change attribute(<name="ctl00$ContentPlaceHolder1$captcha">,"value",$nothing)
        type text(<name="ctl00$ContentPlaceHolder1$captcha">,$solve captcha(<src="/assets/captcha.jpg?id=0.7055475">),"Standard")
        expect($exists(<value="smwm">))
    }
}

Running the script will run all unit testing commands and log the results.

If the expected condition is met, the results are shown in the UI in green.

Expect0.jpg


If the expected condition is notmet, the results are shown in the UI in red.

Expect1.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox