diff --git a/.lambdatest/config.yaml b/.lambdatest/config.yaml new file mode 100644 index 0000000..c9db9d0 --- /dev/null +++ b/.lambdatest/config.yaml @@ -0,0 +1,12 @@ +# LambdaTest Configuration + +# Project and folder configuration +project_id: "01KJA57JN0Z4GSFJXAWCJR26J9" +folder_id: "01KJA580V0AT4TDTZYV1RVNBJE" + +# Test Run configuration +assignee: 3152569 +environment_id: 924 + +# Test URL for automation +test_url: "https://demo.lambdatestinternal.com" diff --git a/hooks/examples/test.js b/hooks/examples/test.js index ba3e3c2..d951b2f 100644 --- a/hooks/examples/test.js +++ b/hooks/examples/test.js @@ -12,6 +12,16 @@ const KEY = process.env.LT_ACCESS_KEY || "accessKey"; // gridUrl: gridUrl can be found at automation dashboard const GRID_HOST = process.env.GRID_HOST || "@hub.lambdatest.com/wd/hub"; //connect to lambdatest hub +function generateDynamicBuildName() { + const now = moment(); + const minutes = now.minutes(); + const roundedMinutes = Math.floor(minutes / 5) * 5; + const timestamp = now.clone().minutes(roundedMinutes).seconds(0).milliseconds(0).format("YYYY-MM-DD_HH-mm"); + + return `Build_${timestamp}`; +} + + async function searchTextOnGoogle() { var keys = process.argv; console.log(keys); @@ -24,7 +34,6 @@ async function searchTextOnGoogle() { // Setup Input capabilities let capabilities = { platform: platform, - build: "Build-" + moment().startOf('minute').subtract(moment().minute() % 5, 'minutes').format("YYYY-MM-DD-HH-mm"), browserName: browserName, version: version, @@ -34,6 +43,7 @@ async function searchTextOnGoogle() { accessKey: KEY, name: "test session", "LT:Options": { + "build": generateDynamicBuildName(), "smartUI.project": "smartuigithub", "smartUI.options": { "output": {