1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-11-06 08:39:09 +02:00

Added support to open blank page

This commit is contained in:
Tim Voronov
2018-10-04 21:37:28 -04:00
parent 71ee1f3dfe
commit c650d28b29
7 changed files with 55 additions and 27 deletions

View File

@@ -1775,23 +1775,28 @@ func TestParam(t *testing.T) {
}
func TestHtml(t *testing.T) {
// Convey("Should load a document", t, func() {
// c := compiler.New()
//
// out, err := c.MustCompile(`
//LET doc = DOCUMENT("https://github.com/", true)
//LET btn = ELEMENT(doc, ".HeaderMenu a")
//
//CLICK(btn)
//WAIT_NAVIGATION(doc)
//WAIT_ELEMENT(doc, '.IconNav')
//
//RETURN INNER_HTML_ALL(doc, '.IconNav a')
//
// `).Run(context.Background())
//
// So(err, ShouldBeNil)
//
// So(string(out), ShouldEqual, `"int"`)
// })
Convey("Should load a document", t, func() {
c := compiler.New()
out, err := c.MustCompile(`
LET doc = DOCUMENT("https://github.com/", true)
LET main = ELEMENT(doc, '.application-main')
LET mainTxt = main.innerText
NAVIGATE(doc, "https://github.com/features")
LET features = ELEMENT(doc, '.application-main')
LET featuresTxt = features.innerText
LOG("featuresTxt:", featuresTxt)
RETURN mainTxt == featuresTxt
`).Run(context.Background())
So(err, ShouldBeNil)
So(string(out), ShouldEqual, `"int"`)
})
}