How alex-ki/ci-test works
Project’s Main Components
• Test Runner & Configuration: At the core is Nightwatch.js (as seen from nightwatch.conf.js) which drives the tests. This component integrates with Node.js and parses the test definitions.
• Test Scripts: The “test” folder houses multiple test files (including directories like group1 and individual tests such as search.js). These files contain the automation scripts that simulate user interactions.
• Page Objects: The “pages” folder (for example, the wiki.js file) is used to encapsulate the application pages and related elements, following the Page Object Model design.
• Custom Commands & Assertions: The “commands” and “assertions” folders provide additional test functionality. For example, commands like strictClick.js extend Nightwatch’s native commands, while custom assertions (e.g., notEmpty.js) verify specific conditions.
• Docker Integration: The Dockerfile and the corresponding Docker commands in the README indicate that tests can be containerized, ensuring a consistent execution environment.
Relationships and Interactions
• The Nightwatch test runner (configured via nightwatch.conf.js) is the central controller. It reads the test files from the “test” folder.
• Test scripts interact with Page Objects (from the “pages” directory) to abstract and centralize the web UI elements.
• The tests leverage custom commands and assertions to perform specific actions and validations.
• When executed, either via the local Node.js environment or within a Docker container, these components work together to simulate, run, and report test results.
• Test results are output as multiple report formats (JUnit XML and HTML), as per the instructions in the README.
Architectural Patterns and Important Design Principles
• Use of the Page Object Model (POM) to encapsulate and separate UI interactions.
• Modular design through separation of concerns: tests, page objects, commands, and assertions are isolated in distinct folders.
• Containerization for consistent test execution using Docker.
• Test grouping (e.g., in “test/group1”) to categorize and manage different suites or modules of tests.