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

Feature/#103 navigate back (#107)

* #103 Added NAVIGATE_BACK function

* Commented out debugging test

* Updated implementation
This commit is contained in:
Tim Voronov
2018-10-12 16:02:53 -04:00
committed by GitHub
parent f91fbf6f8c
commit 93d5df5fe7
6 changed files with 129 additions and 13 deletions

View File

@@ -2104,22 +2104,19 @@ func TestParam(t *testing.T) {
// c := compiler.New()
//
// out, err := c.MustCompile(`
//LET google = DOCUMENT("https://www.google.com/", true)
//LET origin = "https://github.com/"
//LET doc = DOCUMENT(origin, true)
//
//INPUT(google, 'input[name="q"]', "ferret", 25)
//CLICK(google, 'input[name="btnK"]')
//NAVIGATE(doc, "https://github.com/features")
//
//WAIT_NAVIGATION(google)
//WAIT_ELEMENT(google, '.g', 5000)
//LOG("NAVIGATE", doc.url)
//
//NAVIGATE_BACK(doc)
//
//LOG("NAVIGATE_BACK", doc.url)
//
//RETURN doc.url == origin
//
//FOR result IN ELEMENTS(google, '.g')
// // filter out extra elements like videos and 'People also ask'
// FILTER TRIM(result.attributes.class) == 'g'
// RETURN {
// title: INNER_TEXT(result, 'h3'),
// description: INNER_TEXT(result, '.st'),
// url: INNER_TEXT(result, 'cite')
// }
// `).Run(context.Background())
//
// So(err, ShouldBeNil)