diff --git a/assets/images/playwright-testing/lighthouse-report.png b/assets/images/playwright-testing/lighthouse-report.png new file mode 100644 index 000000000..e237014d7 Binary files /dev/null and b/assets/images/playwright-testing/lighthouse-report.png differ diff --git a/docs/biometric-authentication.md b/docs/biometric-authentication.md index c03838d72..72e9f2bae 100644 --- a/docs/biometric-authentication.md +++ b/docs/biometric-authentication.md @@ -74,6 +74,10 @@ Below given is the list of Biometric Authentication APIs which are supported. Pl |`canEvaluatePolicy`: The canEvaluatePolicy(_:error:) method of LAContext that checks whether a specific biometric authentication policy can be evaluated on the device.| + :::warning note + We don’t support apps using IOS Keychain APIs with Biometric access control. For more details [IOS Keychain Documentation](https://developer.apple.com/documentation/localauthentication/accessing-keychain-items-with-face-id-or-touch-id) + ::: + @@ -83,12 +87,14 @@ Below given is the list of Biometric Authentication APIs which are supported. Pl |----------------| | `BiometricPrompt` class's `authenticate` method from the **AndroidX Biometric library** is used for Biometric authentication on Android devices.

📕For details, please check [AndroidX Biometric Documentation](https://developer.android.com/jetpack/androidx/releases/biometric). | | **Android's Native** `BiometricPrompt` API is part of the Android platform and is used for Biometric authentication on Android devices.

📕 For details, please check [Android Developers Documentation](https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt).| + | `BiometricManager` API

📕 For more details [BiometricManager Documentation](https://developer.android.com/reference/android/hardware/biometrics/BiometricManager) | + | `KeyguardManager` API

📕 For more details [KeyguardManager Documentation](https://developer.android.com/reference/android/app/KeyguardManager) |
-:::warning note +:::tip The OS versions and APIs mentioned above are subject to change as per the latest OS updates and best practices recommended by Android and iOS. ::: diff --git a/docs/camera-image-injection.md b/docs/camera-image-injection.md index a1bb64012..19f3cad18 100644 --- a/docs/camera-image-injection.md +++ b/docs/camera-image-injection.md @@ -48,7 +48,6 @@ import TabItem from '@theme/TabItem'; }) }} > - Camera Image Injection feature allows you to test **image capturing, QR code scanning**, and **barcode scanning** functionalities in your app across **3000+ real devices** on the LambdaTest Real Device Cloud platform. This tool is ideal for testing features such as: @@ -84,7 +83,8 @@ Below given is the list of Camera APIs which are supported by LambdaTest Image I | Supported APIs | |----------------| | `didFinishPickingMediaWithInfo` API of `UIImagePickerController` iOS SDK class for capturing an image.

📕 For details, please check [Apple documentation](https://developer.apple.com/documentation/uikit/uiimagepickercontrollerdelegate/1619126-imagepickercontroller)| - | `AVCapturePhoto` iOS SDK class for receiving captured photos from `AVCapturePhotoOutput` API.

📕 For details, please check [Apple Documentation](https://developer.apple.com/documentation/avfoundation/avcapturephoto). | + | `AVCapturePhoto` iOS SDK class for receiving captured photos from `AVCapturePhotoOutput` API.

📕 For details, please check [Apple Documentation](https://developer.apple.com/documentation/avfoundation/avcapturephoto).| + | `AVMetadataMachineReadableCodeObject` is a subclass of `AVMetadataObject` iOS SDK class for scanning QR/Barcodes.

📕 For more details, please check [AVMetadataMachineReadableCodeObject Documentation](https://developer.apple.com/documentation/avfoundation/avmetadatamachinereadablecodeobject) | diff --git a/docs/playwright-desired-capabilities.md b/docs/playwright-desired-capabilities.md index 25820a3ac..e1df31b9f 100644 --- a/docs/playwright-desired-capabilities.md +++ b/docs/playwright-desired-capabilities.md @@ -65,25 +65,5 @@ tests. | geoLocation | AR (Argentina) | Specify country code | `const capability = { "LT:Options": {"geoLocation": "AR",}}`| | idleTimeout | number| Specifies the timeout of the commands in seconds.

Default value: 300

Max value: 1800

If a value greater than 1800 is added, idleTimeout will be set to 1800.| `const capability = { "LT:Options": {"idleTimeout": "",}}`| | lambdaMaskCommands | array | `sendType` or `sendFill` Masks the type method of the ElementHandle and Locator class.

`sendPress` Masks the press method of the ElementHandle and Locator class.

`setHTTPCredentials` Masks the HTTP credentials parameter in the newContext and newPage method of the browser class.

`setStorageState` Masks the storage state parameter in the newContext and newPage method of the browser class

`setGeolocation` Masks the Geolocation parameter in the newContext and newPage method of the browser class.|`const capability = { "LT:Options": {'lambdaMaskCommands': ["sendType", "sendFill", "sendPress", "setHTTPCredentials", "setStorageState", "setGeolocation"]}}`

| -| useSpecificBundleVersion | Boolean | If set **`true`:** LambdaTest will select the playwright server version as per the browser version you have passed in the capabilities. Check the [supported browser version list](/support/docs/playwright-test-execution-setup/#playwright-supported-browsers).

If the value set in the `browser version` capability is supported by multiple Playwright versions, LambdaTest checks your Playwright client version and sets the Playwright version accordingly.


If set **`false` :** LambdaTest will run your playwright tests with the same version as setup in your local system and the browser version will also be used the compatible one as per the [supported browser version list](/support/docs/playwright-test-execution-setup/#playwright-supported-browsers) and not your defined one. | `const capabilities = { "LT:Options": {"useSpecificBundleVersion": true,}}` | - - - +| useSpecificBundleVersion | Boolean | If set **`true`:** LambdaTest will select the playwright server version as per the browser version you have passed in the capabilities. Check the [supported browser version list](/support/docs/playwright-test-execution-setup/#playwright-supported-browsers).

If the value set in the `browser version` capability is supported by multiple Playwright versions, LambdaTest checks your Playwright client version and sets the Playwright version accordingly.


If set **`false` :** LambdaTest will run your playwright tests with the same version as setup in your local system and the browser version will also be used the compatible one as per the [supported browser version list](/support/docs/playwright-test-execution-setup/#playwright-supported-browsers) and not your defined one. | `const capability = { "LT:Options": {"useSpecificBundleVersion": true,}}` | +| lambdaSetBrowserPosition | | The `lambdaSetBrowserPosition` function is designed to arrange two browser windows on the screen, ensuring each occupies exactly half of the available screen space. This layout facilitates side-by-side browser comparisons or multitasking workflows.

OS Supported - Windows

Browsers supported : Chrome, Microsoft Edge , pw-chroium, pw-webkit & pw-firefox | `const capability = {action: 'lambdaSetBrowserPosition',}` | \ No newline at end of file diff --git a/docs/playwright-lighthouse library.md b/docs/playwright-lighthouse library.md index ebb640f53..d93164518 100644 --- a/docs/playwright-lighthouse library.md +++ b/docs/playwright-lighthouse library.md @@ -1,7 +1,7 @@ --- id: playwright-lighthouse-library -title: How to Generate Lighthouse Reports With Playwright Lighthouse Library -hide_title: true +title: Generate Lighthouse Reports With Playwright Lighthouse Library +hide_title: false sidebar_label: Playwright Lighthouse Library description: Learn how to generate multiple Lighthouse reports using Playwright Lighthouse Library. keywords: @@ -13,6 +13,11 @@ site_name: LambdaTest slug: playwright-lighthouse-library/ --- +import CodeBlock from '@theme/CodeBlock'; +import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +A Lighthouse Report is a performance, accessibility, SEO, and best practices evaluation report generated using [Google Lighthouse](https://developers.google.com/web/tools/lighthouse), an open-source, automated tool developed by Google. It is commonly used to assess and optimize the quality of web pages. +LambdaTest lets you perform Playwright automation while allowing you to generate Lighthouse reports with Playwright Lighthouse Library in a single test. -# Generating Lighthouse Reports With Playwright Lighthouse Library ---- +> Lighthouse Report is supported on **Chrome**, **MicrosoftEdge** and **Chromium** browsers. -LambdaTest lets you perform Playwright automation while allowing you to generate Lighthouse reports with Playwright Lighthouse Library in a single test. +:::tip Sample repository +The code sample for generating the Lighthouse Performance Metrics in the Playwright test can be found on **LambdaTest's GitHub Repository**. You can either download or clone the repository to quickly run your tests. Image View on GitHub +::: ## Prerequisites ---- +- Ensure that you have the Playwright Lighthouse Library installed in your web project. + ```bash + npm install playwright-lighthouse + ``` + +- Export the *LIGHTHOUSE_LAMBDATEST* environment variable to your project environment. + ```bash + export LIGHTHOUSE_LAMBDATEST='true' + ``` + +## Write your Test Script +:::info +Generating lighthouse report within the test might increase the test duration. It is advisable to generate the lighthouse reports only in the required tests. +::: + +You can easily add the Lighthouse Performance Metrics of the website you want to test by using the `lighthouseReport` action via the test. Following is the code snippet for generating Lighthouse report from the Playwright if you are using JavaScript: +```js title="playwright-lighthouse-report.js" +await page.evaluate(_ => {}, `lambdatest_action: ${JSON.stringify({ + action: 'lighthouseReport', + arguments: { url: 'https://www.example.com' } +})}`) +``` -You can generate Lighthouse reports on LambdaTest platform while executing Playwright tests with the following steps. +### For Authenticated Pages +> This feature is only supported on **Windows** and **macOS** platforms. -1. Ensure that you have the Playwright Lighthouse Library installed in your web project. +The feature allows you to generate Lighthouse reports for authenticated web pages using Playwright. This is particularly useful for testing performance, accessibility, SEO, and other quality metrics for pages that require authentication. By leveraging authentication tokens, you can analyze restricted pages in your Playwright tests on both **Windows** and **macOS** environments. -```bash -npm install playwright-lighthouse + + + +```javascript +await page.evaluate(() => {}, `lambdatest_action: ${JSON.stringify({ + action: 'lighthouseReport', + arguments: { url: 'https://www.example.com', + args: `--extra-headers + ${JSON.stringify({ authtoken: "YOUR_AUTH_TOKEN" })}` +} })}` ); ``` + -2. Export the *LIGHTHOUSE_LAMBDATEST* environment variable to your project environment. + -```bash -export LIGHTHOUSE_LAMBDATEST='true' +```javascript +await page.evaluate(() => {}, `lambdatest_action: ${JSON.stringify({ + action: 'lighthouseReport', + arguments: { url: 'https://www.example.com', + args: '--extra-headers + "{\\"authtoken\\": \\"YOUR_AUTH_TOKEN\\"}"' +} })}`); ``` + + -## Run the Test ---- +### Sample Test Script + +This following script performs web automation testing using the Playwright and Lighthouse libraries on the LambdaTest platform. The script navigates to the DuckDuckGo search engine and searches for the term "Playwright". After that, the script runs a Lighthouse audit on the specified URL (https://duckduckgo.com) with defined performance thresholds and report formats. -This following script performs web automation testing using the Playwright and Lighthouse libraries on the LambdaTest platform.The script navigates to the DuckDuckGo search engine and searches for the term "Playwright". After that, the script runs a Lighthouse audit on the specified URL (https://duckduckgo.com) with defined performance thresholds and report formats. - -```js -import { chromium } from "playwright"; -import { playAudit } from "playwright-lighthouse"; - -(async () => { - let browser, page; - try { - const capabilities = { - browserName: "Chrome", // Browsers allowed: `Chrome`, `MicrosoftEdge` and `pw-chromium` - browserVersion: "latest", - "LT:Options": { - platform: "Windows 11", - build: "Web Performance testing", - name: "Lighthouse test", - user: process.env.LT_USERNAME, - accessKey: process.env.LT_ACCESS_KEY, - network: true, - video: true, - console: true, - }, - }; - - browser = await chromium.connect({ - wsEndpoint: `wss://cdp.lambdatest.com/playwright?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}` - }); - - page = await browser.newPage(); - - await page.goto("https://duckduckgo.com"); - let element = await page.locator('[name="q"]'); - await element.click(); - await element.type("Playwright"); - await element.press("Enter"); - - try { - await playAudit({ - url: "https://duckduckgo.com", - page: page, - thresholds: { - performance: 50, - accessibility: 50, - "best-practices": 50, - seo: 50, - pwa: 10, - }, - reports: { - formats: { - json: true, - html: true, - csv: true, - }, - }, - }); - - await page.evaluate((_) => {}, - `lambdatest_action: ${JSON.stringify({ action: "setTestStatus", arguments: { status: "passed", remark: "Web performance metrics are are above the thresholds." } })}`); - } catch (e) { - await page.evaluate((_) => {}, - `lambdatest_action: ${JSON.stringify({ action: "setTestStatus", arguments: { status: "failed", remark: e.stack } })}`); - console.error(e); - } - } catch (e) { - await page.evaluate((_) => {}, - `lambdatest_action: ${JSON.stringify({ action: "setTestStatus", arguments: { status: "failed", remark: e.stack } })}`); - } finally { - await page.close(); - await browser.close(); - } -})(); +```javascript reference title="playwright-lighthouse-report.js" +https://github.com/LambdaTest/playwright-sample/blob/main/playwright-lighthouse-report.js ``` -## View Your Test Results ---- +## Trigger your Test on LambdaTest +### Set up your authentication + +Make sure you have your LambdaTest credentials with you to run test automation scripts on LambdaTest. To obtain your access credentials, [purchase a plan](https://billing.lambdatest.com/billing/plans) or access the [Automation Dashboard](https://appautomation.lambdatest.com/). Then, set LambdaTest `Username` and `Access Key` in environment variables with following commands. + + + + +
+ + {`export LT_USERNAME=${ YOUR_LAMBDATEST_USERNAME()} +export LT_ACCESS_KEY=${ YOUR_LAMBDATEST_ACCESS_KEY()}`} + +
+ +
+ + + +
+ + {`set LT_USERNAME=${ YOUR_LAMBDATEST_USERNAME()} +set LT_ACCESS_KEY=${ YOUR_LAMBDATEST_ACCESS_KEY()}`} + +
+ +
+
+ +### Run your test +Pass the below command in the terminal to run the test: +```bash +node RELATIVE_PATH_OF_YOUR_TEST_FILE +``` +### View Your Test Results To view your test runs that uses Playwright Lighthouse Library, go to the LambdaTest [Web Automation Dashboard](https://automation.lambdatest.com/). -Image +Image diff --git a/docs/playwright-lighthouse-performance-metrics.md b/docs/playwright-lighthouse-performance-metrics.md deleted file mode 100644 index 8206b4944..000000000 --- a/docs/playwright-lighthouse-performance-metrics.md +++ /dev/null @@ -1,144 +0,0 @@ ---- -id: playwright-lighthouse-performance-metrics -title: How To View Lighthouse Performance Metrics in Playwright -hide_title: true -sidebar_label: Lighthouse Performance Metrics -description: Guide to view Lighthouse Performance metrics of a website using Playwright. View the Lighthouse audits, scores, metrics, and much more. -keywords: - - lighthouse performance - - lighthouse performance management - - google lighthouse performance - - google lighthouse performance score - - lighthouse partners performance - - lighthouse performance metrics - - lighthouse performance score - - lighthouse performance testing - - lighthouse web performance - - lighthouse website performance - - google lighthouse performance audit - - google lighthouse performance test - - google's own lighthouse for performance accessibility and seo ratings - - how is lighthouse performance score calculated - - lighthouse audit for performance - - lighthouse check performance - - LambdaTest automation - - playwright - - playwright online - - online playwright automation - - playwright automation online - - LambdaTest playwright automation - - playwright tutorial - - Playwright getting started - - lambdatest getting started -url: https://www.lambdatest.com/support/docs/playwright-lighthouse-performance-metrics/ -site_name: LambdaTest -slug: playwright-lighthouse-performance-metrics/ ---- - - - -# View Lighthouse Performance Metrics Using Playwright -* * * - -LambdaTest now integrates [**Lighthouse**](https://developers.google.com/web/tools/lighthouse) to view the performance metrics (**Lighthouse Audits**) while running Playwright tests on the LambdaTest cloud. You can now view the scores of: - -* **Performance**, -* **Accessibility**, -* **Best Practices**, -* **SEO** -* **Progressive Web App** - -metrics with the help of LambdaTest. - -:::tip Sample repository -The code sample for generating the Lighthouse Performance Metrics in the Playwright test can be found on **LambdaTest's GitHub Repository**. You can either download or clone the repository to quickly run your tests. Image View on GitHub -::: - -## Prerequisites - -* * * - -You will need a [LambdaTest account](https://accounts.lambdatest.com/login) to run your Playwright tests. Use your: - -* LambdaTest Username -* LambdaTest Access Key - -to run your tests on LambdaTest and view the **Lighthouse Performance Metrics**. You can obtain these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build) or through [LambdaTest Profile](https://accounts.lambdatest.com/login). - -## How to Include Lighthouse Performance Metrics in Playwright Automation? - -* * * - -You can easily add the Lighthouse Performance Metrics of the website you want to test by executing the `lighthouseReport` action via the test. -As of now, LambdaTest supports **Lighthouse** on Chrome, MicrosoftEdge and Chromium browsers. -Following is the code snippet for generating Lighthouse report from the Playwright if you are using JavaScript: -```js -await page.evaluate(_ => {}, `lambdatest_action: ${JSON.stringify({ - action: 'lighthouseReport', - arguments: { url: 'https://www.example.com' } -})}`) -``` - -> **Note:** Generating lighthouse report within the test might increase the test duration. It is advisable to generate the lighthouse reports only in the required tests. - -## How to View Lighthouse Performance Metrics on LambdaTest? -*** -Once you have run your Playwright automation tests on LambdaTest platform, you can view the Lighthouse Performance Metrics on the website under test. - -Follow the below steps to view the **Lighthouse Performance Metrics** on LambdaTest platform: - -**1.** Go to the [Automation Dashboard](https://automation.lambdatest.com). Here you can see your recently executed Playwright automation tests. For this demo purpose, we have used a sample Playwright JS script, from this [GitHub repository](https://github.com/LambdaTest/playwright-sample/blob/main/playwright-lighthouse-report.js). - -**2.** Open the test where you executed the lighthouse command and click on the **Performance** tab. - -Image - -**3.** You can see the Lighthouse Performance Metrics on your screen now, for the URL requested. For example, in the below image, the lighthouse report is generated for [https://login.live.com](https://login.live.com). - -Image - -Similarly, you can click on any of the performance reports to view it in detail. Performance reports can also be downloaded in various formats. Not only this, but LambdaTest also helps you view the Passed Audits, individual metrics, detailed diagnosis, and improvement opportunities about that particular Lighthouse Audit. - -* * * - -That's it folks! That's all about the Lighthouse Performance Metrics with LambdaTest. You can read more about the Lighthouse Audits and Performance Metrics from [web.dev](https://web.dev/lighthouse-performance/) page. If you have any doubt or questions, feel free to contact our experts at  window.openLTChatWidget()}>**24/7 chat support** or mail us at [support@lambdatest.com](mailto:support@lambdatest.com). Happy testing! :) - - diff --git a/docs/sharding-xcui.md b/docs/sharding-xcui.md index e08f97ab5..541c25715 100644 --- a/docs/sharding-xcui.md +++ b/docs/sharding-xcui.md @@ -258,11 +258,9 @@ You can refer to this example and screenshot below: ::: ## Filters in Sharding - You can filter the Classes / Tests that you'd like to execute using filters. Here's an example of the same. - ```java filters: attributes: @@ -271,31 +269,23 @@ filters: - type: testName values: ["LambdaUiKitIOSUITests/testverifyAppLaunch"] ``` - This example will run only the 2 classes & one test as mentioned from the TestSuite. -## Additional Links +## XCTestPlan in Sharding +To implement the XCTestPlan in Sharding, add the `xctestplan` flag along with `app` and `testSuite` in the [framework](https://www.lambdatest.com/support/docs/hyperexecute-yaml-version0.2/#framework) flag as shown below: ---- +```yaml +framework: + name: "ios/xcui" + args: + "app" : "lt://APP_ID", + "testSuite": "lt://TEST_SUITE_ID", + "xctestplan" : "lt://YOUR_XC_TEST_PLAN_ID" #only when you want to use XCTestPlan +``` +> Refer the documentation to learn how to use [XCTestPlan feature](/support/docs/xctestplan/). + +## Additional Links - [Advanced Configuration for Capabilities](https://www.lambdatest.com/support/docs/desired-capabilities-in-appium/) - [How to test locally hosted apps](https://www.lambdatest.com/support/docs/testing-locally-hosted-pages/) - [How to integrate LambdaTest with CI/CD](https://www.lambdatest.com/support/docs/integrations-with-ci-cd-tools/) - - diff --git a/docs/xctestplan.md b/docs/xctestplan.md index 4f508d152..2fb0e04a7 100644 --- a/docs/xctestplan.md +++ b/docs/xctestplan.md @@ -193,16 +193,14 @@ Take note of the base64 encoded authentication which needs to be added in the -
- - -```bash +```yaml curl --location --request POST 'https://mobile-api.lambdatest.com/framework/v1/xcui/build' \ --header 'Authorization: Basic BASIC_AUTH_TOKEN' \ --header 'Content-Type: application/json' \ --data-raw '{ - "app" : "APP_ID", - "testSuite": "TEST_SUITE_ID", + "app" : "lt://APP_ID", + "testSuite": "lt://TEST_SUITE_ID", + "xctestplan" : "lt://YOUR_XC_TEST_PLAN_ID" #only when you want to use XCTestPlan "device" : ["iPhone 11-14"], "video" : true, "queueTimeout": 10800, @@ -213,23 +211,18 @@ curl --location --request POST 'https://mobile-api.lambdatest.com/framework/v1/x }' ``` - -
-
-
- - -```bash +```yaml curl --location --request POST "https://mobile-api.lambdatest.com/framework/v1/xcui/build" \ --header "Authorization: Basic BASIC_AUTH_TOKEN" \ --header "Content-Type: application/json" \ --data-raw "{ - "app" : "APP_ID", - "testSuite": "TEST_SUITE_ID", + "app" : "lt://APP_ID", + "testSuite": "lt://TEST_SUITE_ID", + "xctestplan" : "lt://YOUR_XC_TEST_PLAN_ID" #only when you want to use XCTestPlan "device" : ["iPhone 11-14"], "video" : true, "queueTimeout": 10800, @@ -239,9 +232,6 @@ curl --location --request POST "https://mobile-api.lambdatest.com/framework/v1/x "build" : "Proverbial-XCUITest" }" ``` - -
-
@@ -249,4 +239,8 @@ curl --location --request POST "https://mobile-api.lambdatest.com/framework/v1/x Once you have run your tests, you can view the test execution along with logs. You will be able to see the test cases passing or failing. You can view the same at [LambdaTest Automation](https://accounts.lambdatest.com/login). -> **NOTE:** You cannot use XCTestPlan and [Filters](/support/docs/speedup-xcui/) simultaneously \ No newline at end of file +> **NOTE:** You cannot use XCTestPlan and [Filters](/support/docs/speedup-xcui/) simultaneously + +:::tip +To learn how to use XCTestPlan with sharding in XCUI, refer to the detailed guide in [Sharding for XCUI](http://localhost:3000/support/docs/sharding-rd-hyperexec/#xctestplan-in-sharding). +::: \ No newline at end of file