From a86fe940ee8c846412b286a7e8ac5298c22c6f83 Mon Sep 17 00:00:00 2001 From: Santoshkumar Sharanappa Nateekar Date: Wed, 18 Sep 2024 17:00:21 -0700 Subject: [PATCH 1/6] update readme with nala commands --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ nala/utils/nala.run.js | 3 ++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b8cbb78ba3..dd56e6fcf0 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ https://feat-branch--project--owner.hlx.page/?milolibs=local (feature code, stag ``` ## Testing +### Unit Testing ```sh npm run test ``` @@ -69,3 +70,42 @@ npm run test:watch ### Coverage `npm run test:watch` can give misleading coverage reports. Use `npm run test` for accurate coverage reporting. +### Nala E2E UI Testing + +#### Running Nala Tests +Nala tests are run using the `npm run nala [options]` command: + +```sh +npm run nala [options] +``` +```sh +# env: [local | libs | branch | stage | etc ] default: local + +# options: + - browser= # Browser to use (default: chrome) + - device= # Device (default: desktop) + - test=<.test.js> # Specific test file to run (runs all tests in the file) + - tag=<@tag> # Tags to filter tests by annotations ex: @test1 @accordion @marquee + - -g, --g=<@tag> # Tags to filter tests by annotations ex: @test1 @accordion @marquee + - mode= # Mode (default: headless) + - config= # Configuration file (default: Playwright default) + - project= # Project configuration (default: milo-live-chromium) + - milolibs= # Milolibs?= + +``` +#### Nala Help Command: +To view examples of how to use Nala commands with various options, you can run +```sh +npm run nala help +``` + +### ⚠️ Important Note +- **Debug and UI Mode Caution**: When using `debug` or `ui` mode, it is recommended to run only a single test using annotations (e.g., `@test1`). Running multiple tests in these modes (e.g., `npm run nala local mode=debug` or `mode=ui`) will launch a separate browser or debugger window for each test, which can quickly become resource-intensive and challenging to manage. + +- **Tip**: To effectively watch or debug, focus on one test at a time to avoid opening excessive browser instances or debugger windows. + + + + + + diff --git a/nala/utils/nala.run.js b/nala/utils/nala.run.js index 11d1354006..d828243c06 100644 --- a/nala/utils/nala.run.js +++ b/nala/utils/nala.run.js @@ -31,7 +31,8 @@ function displayHelp() { | npm run nala local @accordion | Runs only accordion annotated/tagged tests on local environment on chrome browser | | npm run nala local @accordion browser=firefox | Runs only accordion annotated/tagged tests on local environment on firefox browser | | npm run nala local mode=ui | Runs all nala tests on local environment in UI mode on chrome browser | - | npm run nala local tags=@tag1,@tag2 | Runs tests annotated with @tag1 and @tag2 on local environment on chrome browser | + | npm run nala local -g=@accordion | Runs tests annotated with tag i.e @accordion on local env on chrome browser | + | npm run nala local -g=@accordion browser=firefox | Runs tests annotated with tag i.e @accordion on local env on Firefox browser | \x1b[1mDebugging:\x1b[0m ----------- From 7640a636ec4a87b993e8f5abb2bcc6444c5e7a0e Mon Sep 17 00:00:00 2001 From: Santoshkumar Sharanappa Nateekar Date: Wed, 18 Sep 2024 17:24:58 -0700 Subject: [PATCH 2/6] update few command sentences --- README.md | 2 +- nala/utils/nala.run.js | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dd56e6fcf0..d8d713016f 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ To view examples of how to use Nala commands with various options, you can run npm run nala help ``` -### ⚠️ Important Note +#### ⚠️ Important Note - **Debug and UI Mode Caution**: When using `debug` or `ui` mode, it is recommended to run only a single test using annotations (e.g., `@test1`). Running multiple tests in these modes (e.g., `npm run nala local mode=debug` or `mode=ui`) will launch a separate browser or debugger window for each test, which can quickly become resource-intensive and challenging to manage. - **Tip**: To effectively watch or debug, focus on one test at a time to avoid opening excessive browser instances or debugger windows. diff --git a/nala/utils/nala.run.js b/nala/utils/nala.run.js index d828243c06..bcda6d9ebc 100644 --- a/nala/utils/nala.run.js +++ b/nala/utils/nala.run.js @@ -13,13 +13,12 @@ function displayHelp() { \x1b[1m2] Options:\x1b[0m - \x1b[33m* browser=\x1b[0m Browser to use (default: chrome) - \x1b[33m* device=\x1b[0m Device (default: desktop) - \x1b[33m* test=<.test.js>\x1b[0m Test file to run (default: all tests) - \x1b[33m* tag=<@tag>\x1b[0m Tags to filter tests by annotations ex: @test1 @accordion @marquee - \x1b[33m* -g, --g=<@tag>\x1b[0m Tags to filter tests by annotations ex: @test1 @accordion @marquee + \x1b[33m* browser=\x1b[0m Browser to run the test in + \x1b[33m* device=\x1b[0m Device type to run the test on + \x1b[33m* test=<.test.js>\x1b[0m Specific test file to run (runs all tests in the file) + \x1b[33m* -g, --g=<@tag>\x1b[0m Annotation Tag to filter and run tests by annotation (e.g., @test1, @accordion, @marquee) \x1b[33m* mode=\x1b[0m Mode (default: headless) - \x1b[33m* config=\x1b[0m Configuration file (default: Playwright default) + \x1b[33m* config=\x1b[0m Custom configuration file to use (default: Playwright's default) \x1b[33m* project=\x1b[0m Project configuration (default: milo-live-chromium) \x1b[33m* milolibs=\x1b[0m Milo library environment (default: none) From 525655d9184af4bd830b951eccd88ccef56e3b86 Mon Sep 17 00:00:00 2001 From: Santoshkumar Sharanappa Nateekar Date: Wed, 18 Sep 2024 17:27:52 -0700 Subject: [PATCH 3/6] horizontal line --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d8d713016f..d8d9276818 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,9 @@ npm run test:watch `npm run test:watch` can give misleading coverage reports. Use `npm run test` for accurate coverage reporting. ### Nala E2E UI Testing +--- -#### Running Nala Tests +#### 1. Running Nala Tests Nala tests are run using the `npm run nala [options]` command: ```sh @@ -85,15 +86,14 @@ npm run nala [options] - browser= # Browser to use (default: chrome) - device= # Device (default: desktop) - test=<.test.js> # Specific test file to run (runs all tests in the file) - - tag=<@tag> # Tags to filter tests by annotations ex: @test1 @accordion @marquee - - -g, --g=<@tag> # Tags to filter tests by annotations ex: @test1 @accordion @marquee + - -g, --g=<@tag> # Tag to filter tests by annotations ex: @test1 @accordion @marquee - mode= # Mode (default: headless) - config= # Configuration file (default: Playwright default) - project= # Project configuration (default: milo-live-chromium) - milolibs= # Milolibs?= ``` -#### Nala Help Command: +#### 2. Nala Help Command: To view examples of how to use Nala commands with various options, you can run ```sh npm run nala help From 749ba5ce0ba02dba9461bbeec0a8834ac8ce2484 Mon Sep 17 00:00:00 2001 From: Santoshkumar Sharanappa Nateekar Date: Wed, 18 Sep 2024 17:30:02 -0700 Subject: [PATCH 4/6] update horizontal line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d8d9276818..fcdd1ac38b 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ npm run test:watch `npm run test:watch` can give misleading coverage reports. Use `npm run test` for accurate coverage reporting. ### Nala E2E UI Testing ---- +___ #### 1. Running Nala Tests Nala tests are run using the `npm run nala [options]` command: From 3db7e0cf5ba964627ada03dda770aa35723d7103 Mon Sep 17 00:00:00 2001 From: Santoshkumar Sharanappa Nateekar Date: Wed, 18 Sep 2024 17:40:42 -0700 Subject: [PATCH 5/6] update heading --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fcdd1ac38b..b47f84f07f 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ npm run test:watch `npm run test:watch` can give misleading coverage reports. Use `npm run test` for accurate coverage reporting. ### Nala E2E UI Testing -___ +----- #### 1. Running Nala Tests Nala tests are run using the `npm run nala [options]` command: From 748c37e87b508fd2a58525c76a30f95049fe866a Mon Sep 17 00:00:00 2001 From: Santoshkumar Sharanappa Nateekar Date: Wed, 18 Sep 2024 18:40:34 -0700 Subject: [PATCH 6/6] update nala wiki link --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b47f84f07f..e5639acff0 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,9 @@ npm run nala help - **Tip**: To effectively watch or debug, focus on one test at a time to avoid opening excessive browser instances or debugger windows. +#### 3. Nala Documentation +For detailed guides and documentation on Nala, please visit the [Nala GitHub Wiki](https://github.com/adobecom/milo/wiki/Nala#nala-introduction). +