mirror of
https://github.com/MontFerret/ferret.git
synced 2025-12-05 22:26:09 +02:00
Migration to lab (#526)
* Switched to Lab for e2e tests * Switched to binary * Updated lab installation * Updated use of Lab installer * updates * Changed lab installation path * Updated use of installer * Works * Added additional functions * Updated some tests * Updated go.sum * Works * Refactored assertions * Added tests for testing.True * Added tests for testing.None * Added tests for testing.Lte * Added tests for testing.Lt * Added generic consturctor * Added tests for testing.Len * Added tests for testing.Gte * Added tests for testing.Gt * Added tests for testing.False * Added tests for testing.Empty * Added tests for testing.Fail * Added tests for testing.Equal * Added tests for testing.Include * Updated urls in static page tests * Fixed namespace unit tests * Fixed unit test for testing.Len * Updated E2E scripts * Updaes * Updated Chrome in CI/CD * Added e2e for example test click.fql * Added suite cases for example scripts * Updated examples * Updated * Added type assertions * Updated Chrome opts and disabled headers and cookies related tests * Fixed iframes example * Increased timeouts in navigation examples * Updated value example * Updated comments * Disabled cookies examples * Fixed static url * Disabled headers examples * Disabled UA test * Simplified wait logic * Added base testing module * Fixes after codereview * Disabled failing tests
This commit is contained in:
@@ -13,7 +13,7 @@ func TestNamespaceBuilder(t *testing.T) {
|
||||
Convey("Namespaces", t, func() {
|
||||
Convey("Should return an error when a function name contains NS separator", func() {
|
||||
c := compiler.New()
|
||||
err := c.RegisterFunction("T::SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
err := c.RegisterFunction("FOO::SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
return values.None, nil
|
||||
})
|
||||
|
||||
@@ -22,7 +22,7 @@ func TestNamespaceBuilder(t *testing.T) {
|
||||
|
||||
Convey("Should successfully register a name within a namespace", func() {
|
||||
c := compiler.New()
|
||||
err := c.Namespace("T").RegisterFunction("SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
err := c.Namespace("FOO").RegisterFunction("SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
return values.None, nil
|
||||
})
|
||||
|
||||
@@ -33,7 +33,7 @@ func TestNamespaceBuilder(t *testing.T) {
|
||||
var exists bool
|
||||
|
||||
for _, name := range funcs {
|
||||
exists = name == "T::SPY"
|
||||
exists = name == "FOO::SPY"
|
||||
|
||||
if exists {
|
||||
break
|
||||
@@ -45,7 +45,7 @@ func TestNamespaceBuilder(t *testing.T) {
|
||||
|
||||
Convey("Root namespace should return all registered functions", func() {
|
||||
c := compiler.New()
|
||||
err := c.Namespace("T").RegisterFunction("SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
err := c.Namespace("FOO").RegisterFunction("SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
return values.None, nil
|
||||
})
|
||||
|
||||
@@ -58,23 +58,23 @@ func TestNamespaceBuilder(t *testing.T) {
|
||||
|
||||
Convey("Namespace should return all registered functions", func() {
|
||||
c := compiler.New()
|
||||
err := c.Namespace("T").RegisterFunction("SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
err := c.Namespace("FOO").RegisterFunction("SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
return values.None, nil
|
||||
})
|
||||
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
err = c.Namespace("T").Namespace("UTILS").RegisterFunction("SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
err = c.Namespace("FOO").Namespace("UTILS").RegisterFunction("SPY", func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
return values.None, nil
|
||||
})
|
||||
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
funcs := c.Namespace("T").RegisteredFunctions()
|
||||
funcs := c.Namespace("FOO").RegisteredFunctions()
|
||||
|
||||
So(funcs, ShouldHaveLength, 2)
|
||||
|
||||
funcs2 := c.Namespace("T").Namespace("UTILS").RegisteredFunctions()
|
||||
funcs2 := c.Namespace("FOO").Namespace("UTILS").RegisteredFunctions()
|
||||
|
||||
So(funcs2, ShouldHaveLength, 1)
|
||||
})
|
||||
@@ -84,7 +84,7 @@ func TestNamespaceBuilder(t *testing.T) {
|
||||
noop := func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
|
||||
return values.None, nil
|
||||
}
|
||||
err := c.Namespace("T::").RegisterFunction("SPY", noop)
|
||||
err := c.Namespace("FOO::").RegisterFunction("SPY", noop)
|
||||
|
||||
So(err, ShouldNotBeNil)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user