Nested test structures?
See original GitHub issueTrying 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");
});
});
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
JUnit 5 Nested Tests: Grouping Related Tests Together
JUnit 5 nested tests give us a way to construct a hierarchy in the tests. We can organize the tests in a logical...
Read more >Testing nested structures with AssertJ - DEV Community
In this post I would like to describe a nice pattern that helps testing nested structures with AssertJ. Let's imagin there is a...
Read more >JUnit 5 Nested Class: @Nested Tutorial With Examples
Nested class as the name suggests is the class that is placed inside another class and is arranged in a hierarchical structure. We...
Read more >JUnit 5 Nested Tests - Mkyong.com
3.1 For big class, we should consider the @Nested tests, all tests in a single test class (in a hierarchical structure), and the...
Read more >CSC 212 Notes - Nested Decision Structures
The nesting of decision structures allows a program to sequentially determine the current state of a problem component under investigation. One might find...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this can be closed as all helpers have
restart: false
option which can be used to reuse browser session@markerikson That may interest you https://github.com/Codeception/CodeceptJS/pull/167