Running Nightwatch Test on AWS Pipeline

69 views
Skip to first unread message

Sumit Saxena

unread,
Jan 27, 2021, 11:57:34 PM1/27/21
to NightwatchJs
Hi All , 

       Iam trying to execute my nightwatch test but getting Error - : Chrome invocation on port 4444 .

Nightwatch Json - 

{
"src_folders": [
"e2e/tests/"
],
"page_objects_path": [
"e2e/page-objects/"
],
"globals_path": "./globals.js",
"test_settings": {
"default": {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true,
"chromeOptions" : {
"w3c": false,
"args" : ["disable-web-security", "ignore-certificate-errors", "headless","no-sandbox",
"disable-gpu"]
}
},
"webdriver": {
"start_process": true,
"port": 5555,
"server_path": "node_modules/.bin/chromedriver"
}
},
"test_workers": {
"enabled": true,
"workers": "auto"
},
"firefox": {
"desiredCapabilities": {
"browserName": "firefox",
"moz:firefoxOptions": {
"args": [
"-P",
"nightwatch"
]
}
},
"webdriver": {
"start_process": true,
"port": 4444,
"server_path": "./node_modules/geckodriver/bin/geckodriver"
}
}
}
}


BuildSpec.yml 

version: 0.2


phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws --version
- $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_TAG=build-$(echo $CODEBUILD_BUILD_ID | awk -F":" '{print $2}')
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- docker build -t $REPOSITORY_URI:latest .
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker images...
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$IMAGE_TAG
- echo Writing image definitions file...
- printf '[{"name":"nodeapp","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
- cat imagedefinitions.json
- npm install
- npm i yarn
- Yarn e2e --url ’https://pfc-dev-e2e-tenant1.powerfaidscloud-nonprod.collegeboard.org/#/mod-ui/' --uid 'ymali' --pwd 'Password123!' --suiteRetries 1
artifacts:
files: imagedefinitions.json


Any idea , what is wrong with the setup.

Thanks,
Sumit

Reply all
Reply to author
Forward
0 new messages