Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cypress certification #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions cypress/dragAndDrop.cy.js
Original file line number Diff line number Diff line change
@@ -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}`);
}
});
});
});
9 changes: 4 additions & 5 deletions lambdatest-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "<path_of_cypress_spec_files>",
"ignore_files": "",
"feature_file_suppport": false,
"network": false,
"headless": false,
"reporter_config_file": "",
"npm_dependencies": {
"cypress": "9.0.0"
"cypress": "9.6"
}
},
"tunnel_settings": {
Expand Down
4 changes: 2 additions & 2 deletions lambdatest_run.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"build_id": "25977707",
"session_id": "7644c00e-9b2d-4009-a831-6527d91788b7"
"build_id": "29236347",
"session_id": "214bf3a6-ed1c-4a21-9543-1b12515b0a14"
}