From 34f819fb16dd05a1aa7201487022decbba09bb86 Mon Sep 17 00:00:00 2001 From: sfarhan1998 <160848221+sfarhan1998@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:25:23 +0530 Subject: [PATCH] cypress certification --- cypress/dragAndDrop.cy.js | 34 ++++++++++++++++++++++++++++++++++ lambdatest-config.json | 9 ++++----- lambdatest_run.json | 4 ++-- 3 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 cypress/dragAndDrop.cy.js diff --git a/cypress/dragAndDrop.cy.js b/cypress/dragAndDrop.cy.js new file mode 100644 index 0000000..7440ffc --- /dev/null +++ b/cypress/dragAndDrop.cy.js @@ -0,0 +1,34 @@ +describe('Test Scenario 1', function() { + it('Should drag slider to set value to 95 horizontally', function() { + // Visit the Selenium Playground page + cy.visit('https://www.lambdatest.com/selenium-playground'); + + // Click on "Drag & Drop Sliders" + cy.contains('Drag & Drop Sliders').click(); + + // Get the slider input element with value '15' and ensure it's visible + cy.get("input[value='15']").should('be.visible').then((slider) => { + // Set the initial value of the slider (start position) + slider.clear().type(0); // Clear any existing value and type the new value + + // Define the target value for the slider + const targetValue = 95; + + // Calculate the number of steps and the value increment for each step + const steps = 20; // Increasing steps for smoother movement + const increment = targetValue / steps; + + // Perform dragging slowly by triggering mousemove events with delays + let currentValue = 0; + while (currentValue < targetValue) { + cy.wait(100); // Adjust the delay as needed (e.g., 100 milliseconds) + currentValue += increment; + if (currentValue > targetValue) { + currentValue = targetValue; // Ensure currentValue doesn't exceed targetValue + } + slider.clear().type(currentValue); // Clear any existing value and type the new value + cy.log(`Current value of slider: ${currentValue}`); + } + }); + }); +}); diff --git a/lambdatest-config.json b/lambdatest-config.json index 2f9a466..073301f 100644 --- a/lambdatest-config.json +++ b/lambdatest-config.json @@ -21,16 +21,15 @@ ], "run_settings": { "cypress_config_file": "cypress.json", + "reporter_config_file": "base_reporter_config.json", "build_name": "build-name", - "parallels": 2, - "specs": "./cypress/integration/examples/*.spec.js", + "parallels": 1, + "specs": "", "ignore_files": "", - "feature_file_suppport": false, "network": false, "headless": false, - "reporter_config_file": "", "npm_dependencies": { - "cypress": "9.0.0" + "cypress": "9.6" } }, "tunnel_settings": { diff --git a/lambdatest_run.json b/lambdatest_run.json index fe09535..2b0e601 100644 --- a/lambdatest_run.json +++ b/lambdatest_run.json @@ -1,4 +1,4 @@ { - "build_id": "25977707", - "session_id": "7644c00e-9b2d-4009-a831-6527d91788b7" + "build_id": "29236347", + "session_id": "214bf3a6-ed1c-4a21-9543-1b12515b0a14" } \ No newline at end of file