|
| 1 | + |
1 | 2 | 
|
2 | 3 |
|
3 | 4 | # Node fetch sessions
|
4 |
| - |
5 | 5 | [](https://www.npmjs.com/package/@lambdatest/node-fetch-sessions)
|
6 | 6 |
|
7 |
| -A command-line interface(CLI) to fetch [LambdaTest](https://www.lambdatest.com) automation session details through [@lambdatest/node-rest-client](https://www.npmjs.com/package/@lambdatest/node-rest-client). |
| 7 | +A command-line interface(CLI) to fetch [LambdaTest](https://automation.lambdatest.com/build) automation session details through [@lambdatest/node-rest-client](https://www.npmjs.com/package/@lambdatest/node-rest-client). |
8 | 8 |
|
9 |
| -## Installation |
| 9 | +### Steps to fetch LambdaTest automation session details |
| 10 | + |
| 11 | +#### Step 1. Installation |
10 | 12 |
|
11 | 13 | ```
|
12 |
| -npm i -g @lambdatest/node-fetch-sessions |
| 14 | +$ npm i -g @lambdatest/node-fetch-sessions |
13 | 15 | ```
|
14 | 16 |
|
15 |
| -## Example |
16 |
| - |
17 |
| -```sh |
18 |
| - |
19 |
| -// The username for the LambdaTest account |
20 |
| -export LT_USERNAME=abc |
21 |
| - |
22 |
| -// The accessKey for the LambdaTest account |
23 |
| -export LT_ACCESS_KEY=def |
24 |
| - |
25 |
| -// The build name whose test session information is to be fetched |
26 |
| -export LT_BUILD_NAME=Demo |
27 |
| - |
28 |
| -## Retrieve sessions list |
29 |
| -fetch-Lt-sessions |
30 |
| - |
31 |
| -## Support for enhanced cypress reporting |
32 |
| -fetch-Lt-sessions --enhancedCyReport |
| 17 | +#### Step 2. Set LambdaTest Username and Access Key in environment variables. |
| 18 | + |
| 19 | +For Linux/macOS: |
| 20 | +``` |
| 21 | +$ export LT_USERNAME="YOUR_USERNAME" |
| 22 | +$ export LT_ACCESS_KEY="YOUR ACCESS KEY" |
| 23 | +``` |
| 24 | +For Windows: |
| 25 | +``` |
| 26 | +$ set LT_USERNAME="YOUR_USERNAME" |
| 27 | +$ set LT_ACCESS_KEY="YOUR ACCESS KEY" |
33 | 28 | ```
|
34 | 29 |
|
35 |
| -## **License** |
36 |
| - |
37 |
| -Node fetch sessions is available under the [Apache License 2.0](https://github.com/LambdaTest/node-fetch-session/blob/main/LICENSE). Use it wisely. |
38 |
| - |
39 |
| -## About LambdaTest |
| 30 | +#### Step 3. Set Build Name for which the test session information is required |
| 31 | +For Linux/macOS: |
| 32 | +``` |
| 33 | +$ export LT_BUILD_NAME="<Add Build Name>" |
| 34 | +``` |
| 35 | +For Windows: |
| 36 | +``` |
| 37 | +$ set LT_BUILD_NAME="<Add Build Name>" |
| 38 | +``` |
40 | 39 |
|
41 |
| -[LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=node-fetch-session) is a leading test execution and orchestration platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs. |
| 40 | +#### Step 4. Retrieve the list of automation sessions |
| 41 | +``` |
| 42 | +$ fetch-Lt-sessions |
| 43 | +``` |
| 44 | +#### Expected Output |
| 45 | +``` |
| 46 | +{ |
| 47 | + "success":true, |
| 48 | + "error":"", |
| 49 | + "msg":"session listing retrieved", |
| 50 | + "data": |
| 51 | + { |
| 52 | + "Meta":{"attributes":{"org_id":******}, |
| 53 | + "result_set":{"count":1,"limit":10000,"offset":0,"total":1}}, |
| 54 | + "data":[{"test_id":"****-*****-*****-*****", |
| 55 | + "build_id":*******, |
| 56 | + "build_name":"Python Slack Test Demo", |
| 57 | + "user_id":******, |
| 58 | + "username":"*****", |
| 59 | + "status_ind":"passed", |
| 60 | + "create_timestamp":"2022-09-12 15:03:35", |
| 61 | + "start_timestamp":"2022-09-12 15:03:49", |
| 62 | + "end_timestamp":"2022-09-12 15:04:11", |
| 63 | + "remark":"completed", |
| 64 | + "browser":"firefox", |
| 65 | + "platform":"win11", |
| 66 | + "version":"100.0", |
| 67 | + "name":"Python Demo Test", |
| 68 | + "session_id":"*****-*****-*****-*****", |
| 69 | + "duration":"22", |
| 70 | + "test_type":"selenium", |
| 71 | + "selenium_logs":"Link to selenium logs", |
| 72 | + "console_logs":"Link to console logs ", |
| 73 | + "network_logs":"link to network logs", |
| 74 | + "command_logs":"link to command logs", |
| 75 | + "video_url":"link to the test video", |
| 76 | + "screenshot_url":"link to the screenshot"}], |
| 77 | + "message":"Retrieve build list was successful", |
| 78 | + "status":"success"} |
| 79 | + } |
| 80 | +``` |
| 81 | +#### Note: In order to retreive the list of only Cypress tests run the command below |
| 82 | +``` |
| 83 | +$ fetch-Lt-sessions --enhancedCyReport |
| 84 | +``` |
| 85 | +#### Expected Output |
| 86 | +``` |
| 87 | +{ |
| 88 | + "success":true, |
| 89 | + "error":"", |
| 90 | + "msg":"Retrieve enhanced cypress report was successfull", |
| 91 | + "data":[ |
| 92 | + "*****-*****-*****-*****":{ |
| 93 | + "stats":{"suites":1,"tests":3,"passes":2,"pending":0,"failures":1, |
| 94 | + "start":"2022-09-06T10:03:01.902Z", |
| 95 | + "end":"2022-09-06T10:03:12.146Z", |
| 96 | + "duration":10244, |
| 97 | + "testsRegistered":6, |
| 98 | + "passPercent":33.33333333333333, |
| 99 | + "pendingPercent":0, |
| 100 | + "other":0, |
| 101 | + "hasOther":false, |
| 102 | + "skipped":0, |
| 103 | + "hasSkipped":false}, |
| 104 | + "results":[ |
| 105 | + {"uuid":"", |
| 106 | + "title":"", |
| 107 | + "fullFile":"", |
| 108 | + "file":"", |
| 109 | + "beforeHooks":null, |
| 110 | + "afterHooks":null, |
| 111 | + }]}} |
| 112 | + ] |
| 113 | +} |
| 114 | +``` |
42 | 115 |
|
43 |
| -### Features |
| 116 | +#### In case your Build _does not_ have a Cypress test the Command Line Interface returns the following |
| 117 | +``` |
| 118 | +No cypress tests found in the build with name <Your Build Name> |
| 119 | +``` |
| 120 | +### License |
| 121 | +Node fetch sessions is available under the [Apache License 2.0.](https://github.com/LambdaTest/node-fetch-session/blob/main/LICENSE) Use it wisely. |
| 122 | + |
| 123 | +### About LambdaTest |
| 124 | +[LambdaTest](https://www.lambdatest.com/) is a leading test execution and orchestration platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs. |
| 125 | + |
| 126 | +#### Features |
| 127 | +- Run Selenium, Cypress, Puppeteer, Playwright, and Appium automation tests across 3000+ real desktop and mobile environments. |
| 128 | +- Real-time cross browser testing on 3000+ environments. |
| 129 | +- Test on Real device cloud |
| 130 | +- Blazing fast test automation with HyperExecute |
| 131 | +- Accelerate testing, shorten job times and get faster feedback on code changes with Test At Scale. |
| 132 | +- Smart Visual Regression Testing on cloud |
| 133 | +- 120+ third-party integrations with your favorite tool for CI/CD, Project Management, Codeless Automation, and more. |
| 134 | +- Automated Screenshot testing across multiple browsers in a single click. |
| 135 | +- Local testing of web and mobile apps. |
| 136 | +- Online Accessibility Testing across 3000+ desktop and mobile browsers, browser versions, and operating systems. |
| 137 | +- Geolocation testing of web and mobile apps across 53+ countries. |
| 138 | +- LT Browser - for responsive testing across 50+ pre-installed mobile, tablets, desktop, and laptop viewports |
44 | 139 |
|
45 |
| -- Run Selenium, Cypress, Puppeteer, Playwright, and Appium automation tests across 3000+ real desktop and mobile environments. |
46 |
| -- Real-time cross browser testing on 3000+ environments. |
47 |
| -- Test on Real device cloud |
48 |
| -- Blazing fast test automation with HyperExecute |
49 |
| -- Accelerate testing, shorten job times and get faster feedback on code changes with Test At Scale. |
50 |
| -- Smart Visual Regression Testing on cloud |
51 |
| -- 120+ third-party integrations with your favorite tool for CI/CD, Project Management, Codeless Automation, and more. |
52 |
| -- Automated Screenshot testing across multiple browsers in a single click. |
53 |
| -- Local testing of web and mobile apps. |
54 |
| -- Online Accessibility Testing across 3000+ desktop and mobile browsers, browser versions, and operating systems. |
55 |
| -- Geolocation testing of web and mobile apps across 53+ countries. |
56 |
| -- LT Browser - for responsive testing across 50+ pre-installed mobile, tablets, desktop, and laptop viewports |
|
0 commit comments