Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support setting reporters for TestCafe #832

Merged
merged 6 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions api/saucectl.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1778,6 +1778,15 @@
"2.0.1",
"2.0.0"
]
},
"configFile": {
"description": "The TestCafe configuration file.",
"type": "string",
"examples": [
"testcaferc.json",
"testcaferc.js",
"testcaferc.cjs"
]
}
},
"required": [
Expand Down
9 changes: 9 additions & 0 deletions api/v1alpha/framework/testcafe.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@
"2.0.1",
"2.0.0"
]
},
"configFile": {
"description": "The TestCafe configuration file.",
"type": "string",
"examples": [
"testcaferc.json",
"testcaferc.js",
"testcaferc.cjs"
]
}
},
"required": [
Expand Down
5 changes: 4 additions & 1 deletion internal/cmd/run/testcafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ func NewTestcafeCmd() *cobra.Command {
sc.Fset = cmd.Flags()
sc.String("name", "suite::name", "", "Set the name of the job as it will appear on Sauce Labs")

// TestCafe
sc.String("testcafe.version", "testcafe::version", "", "The TestCafe version to use")
sc.String("testcafe.configFile", "testcafe::configFile", "", "The path to TestCafe config file")

// Browser & Platform
sc.String("browser", "suite::browserName", "", "Run tests against this browser")
sc.String("browserVersion", "suite::browserVersion", "", "The browser version (default: latest)")
Expand Down Expand Up @@ -104,7 +108,6 @@ func NewTestcafeCmd() *cobra.Command {

// Misc
sc.String("rootDir", "rootDir", ".", "Control what files are available in the context of a test run, unless explicitly excluded by .sauceignore")
sc.String("testcafe.version", "testcafe::version", "", "The TestCafe version to use")
sc.StringSlice("clientScripts", "suite::clientScripts", []string{}, "Inject scripts from the specified files into each page visited during the tests")
sc.Float64("speed", "suite::speed", 1, "Specify the test execution speed")
sc.Bool("disablePageCaching", "suite::disablePageCaching", false, "Prevent the browser from caching page content")
Expand Down
2 changes: 2 additions & 0 deletions internal/testcafe/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ type Screenshots struct {
type Testcafe struct {
// Version represents the testcafe framework version.
Version string `yaml:"version,omitempty" json:"version"`
// ConfigFile represents the testcafe config file
ConfigFile string `yaml:"configFile,omitempty" json:"configFile"`
}

// FromFile creates a new testcafe project based on the filepath.
Expand Down
Loading