Trying to play around with CodeceptJS, having never actually used Mocha or anything similar before. Mocha's docs seem to indicate that you can set up nested tests using describe() and it(). It looks like Codecept's Feature() and Scenario() are an alternative method to setting up Mocha's Suites. Is there a similar way to set up nested tests using CodeceptJS? For example, something vaguely like:
Feature('Test1');
Before((I) => { // or Background
I.amOnPage('/');
});
Scenario('Interact with the login page ', (I) => {
Feature("Test 1 - Part 1");
Scenario("Filling in login form shows consent banner", () => {
I.see('Username');
I.dontSee("You are accessing");
I.fillField("httpd_username", "user1");
I.fillField("httpd_password", "pw1");
I.see("You are accessing");
});
Feature("Test 1 - Part 2");
Scenario('Can log in successfully', () => {
I.see('Username');
I.fillField("httpd_username", "user1");
I.fillField("httpd_password", "pw1");
I.click('Agree and Log In');
I.wait(1);
I.dontSee("Username");
});
});
Trying to play around with CodeceptJS, having never actually used Mocha or anything similar before. Mocha's docs seem to indicate that you can set up nested tests using
describe()andit(). It looks like Codecept'sFeature()andScenario()are an alternative method to setting up Mocha's Suites. Is there a similar way to set up nested tests using CodeceptJS? For example, something vaguely like: