testcafe
testcafe copied to clipboard
Random error in beforeEach hook: write EPIPE
What is your Scenario?
For executing the test scenarios in different situations (on-build, nightly, regression) Jenkins configuration is used. Because the folder structure is not the same for every type of build, a shell script is created and it searches for the files to execute depending on the parameters with which is called. Because of this, we had to introduce fixture-meta in our function and tests and since then, the EPIPE error appeared. It is not happening all the time and it's not always on the same scenarios.
Shell function:
Fixture settings:
What is the Current behavior?
Described above
What is the Expected behavior?
No error should appear, all the tests shall be executed.
What is your public website URL? (or attach your complete example)
Site is not public, but this problem was not present until we introduced the meta-fixture.
What is your TestCafe test code?
fixture ('Atlantis tests HRM')
.meta('type', 'SmokeTests-nightly')
.meta('system', 'HRM')
.before( async ctx => {
ctx.pwd=process.env.TESTUSER_PSW;
ctx.acc=process.env.TESTUSER_USR;
})
.beforeEach(async t=>{
//Log-In Areea
await t.maximizeWindow() await loginUser.login(t.fixtureCtx.acc, t.fixtureCtx.pwd)
})
class LogIn{ constructor(){ //selectors this.acceptCookiesButton = Selector('#onetrust-accept-btn-handler') this.loginButton = Selector('input[id="LoginButton"]') this.userNameField = Selector('input[id="Username"]') this.passwordField = Selector('input[id="Password"]') }
async login (username, password) {
await t
.click(this.acceptCookiesButton)
.typeText(this.userNameField, username, {paste: true, replace: true})
.click(this.loginButton)
.typeText(this.passwordField, password, {paste: true, replace: true})
.click(this.loginButton)
}
}
Your complete configuration file
No response
Your complete test report
Screenshots
No response
Steps to Reproduce
Run any test scenario (*.js file) with the function runWeb.sh in which to use meta-fixture. Run it from Jenkins several times, because the error does not appear all the time and not on the same test.
TestCafe version
it is installed every run with npm installed
Node.js version
No response
Command-line arguments
testcafe chrome:headless *.js
Browser name(s) and version(s)
No response
Platform(s) and version(s)
No response
Other
No response