I have more than 1000 lines of test steps in smoke test like this :
test("Smoke Test", async (t) => {
console.log("Starting test");
// want to take out this in another class AuthStep.
await AuthPage.setUserName("testtest@hotmail.com"); // AuthPage - page object model
await AuthPage.setUserPassword("123456");
//end of AuthClass
await t.expect(getUrl()).eql(authUrl);
await t.expect(getUrl()).eql(loginUrl + "auth", { timeout: 100000 });
await MainPage.setUserType(userName);
....
}
I just want to optimize this Smoke test and for example, move these steps into separate classes that will runs in the in Smoketest. How can I do it in TestCafe framework?