diff --git a/README.md b/README.md new file mode 100644 index 0000000..b92b2c4 --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +Sprint #8 Project + +This is a WebdriverIO automated testing suite for the Urban Routes app. This test checks the functionality of the app. Each test is designed to test the full process of ordering a taxi. 9/9 tests in this project PASS. + +Prepared/executed test cases in Visual Studio/VS Code for automated response via Urban Routes app server. WebdriverIO Javascript and Mocha functions were used for the coding of this project. Git and npm commands were used to run tests in the console. + +Prerequisite Software Installation: WebdriverIO, VS Code, npm install. + +1. Create a directory. Open the Git Bash console and enter the commands: +>cd ~ +>mkdir Projects +>cd Projects + +2. Clone the repository. From the Git Bash console, run the command: +>git clone git@github.com:username/hm08-qa-us.git. + +3. Install packages. From the console project folder, run the command: +>npm install + +4. To start project testing in VS Code: +>Open VS Code +>Select file +>Open folder +>Select the hm08-qa-us folder + +5. Configure the server URL in VS Code: +>Go to the wdio.conf.js file +>Replace the server URL (value of baseUrl) with a newly generated URL from the Urban Routes server + +6. To run test in VS Code, enter into console: +>npm run wdio + + + + + + + + + + + + + + + diff --git a/helper.js b/helper.js index f870bd9..ba013d5 100644 --- a/helper.js +++ b/helper.js @@ -5,5 +5,13 @@ module.exports = { }, getElementByText: async function(obj) { return await $(`div=${obj.toString()}`); + }, + getCardNumber: function(){ + const number = Math.floor(Math.random() * 1000000000000) + return number + }, + getCvvNumber: function(){ + const number = Math.floor(Math.random() * 100) + return number } }; diff --git a/package-lock.json b/package-lock.json index 1df9bc2..aa4cf47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@wdio/local-runner": "^8.6.7", "@wdio/mocha-framework": "^8.6.6", "@wdio/spec-reporter": "^8.6.6", - "chromedriver": "^111.0.0", + "chromedriver": "^129.0.1", "eslint": "^8.38.0", "eslint-plugin-mocha": "^10.1.0", "eslint-plugin-wdio": "^8.0.14", @@ -892,10 +892,18 @@ } }, "node_modules/@testim/chrome-version": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.3.tgz", - "integrity": "sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A==", - "dev": true + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz", + "integrity": "sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "dev": true, + "license": "MIT" }, "node_modules/@tracerbench/trace-event": { "version": "8.0.0", @@ -1591,6 +1599,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/async": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", @@ -1609,7 +1630,8 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/available-typed-arrays": { "version": "1.0.5", @@ -1632,12 +1654,13 @@ } }, "node_modules/axios": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", - "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "dev": true, + "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -1691,6 +1714,16 @@ } ] }, + "node_modules/basic-ftp": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -2306,25 +2339,26 @@ } }, "node_modules/chromedriver": { - "version": "111.0.0", - "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-111.0.0.tgz", - "integrity": "sha512-XavNYNBBfKIrT8Oi/ywJ0DoOOU+jHF5bQWTkqStFsAXvfCV9VzYN3J+TGAvZdrpXeoixqPRGUxQ2yZhD2iowdQ==", + "version": "129.0.4", + "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-129.0.4.tgz", + "integrity": "sha512-j5I55cQwodFJUaYa1tWUmj2ss9KcPRBWmUa5Qonq3X8kqv2ASPyTboFYb4YB/YLztkYTUUw2E43txXw0wYzT/A==", "dev": true, "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { - "@testim/chrome-version": "^1.1.3", - "axios": "^1.2.1", - "compare-versions": "^5.0.1", + "@testim/chrome-version": "^1.1.4", + "axios": "^1.7.4", + "compare-versions": "^6.1.0", "extract-zip": "^2.0.1", - "https-proxy-agent": "^5.0.1", + "proxy-agent": "^6.4.0", "proxy-from-env": "^1.1.0", - "tcp-port-used": "^1.0.1" + "tcp-port-used": "^1.0.2" }, "bin": { "chromedriver": "bin/chromedriver" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/chromium-bidi": { @@ -2526,6 +2560,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -2534,10 +2569,11 @@ } }, "node_modules/compare-versions": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-5.0.3.tgz", - "integrity": "sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A==", - "dev": true + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", + "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", + "dev": true, + "license": "MIT" }, "node_modules/compress-commons": { "version": "4.1.1", @@ -2700,6 +2736,16 @@ "node": ">=0.10.0" } }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -2838,11 +2884,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -3184,6 +3246,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, "node_modules/eslint": { "version": "8.39.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.39.0.tgz", @@ -3952,9 +4036,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "dev": true, "funding": [ { @@ -3962,6 +4046,7 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -4006,10 +4091,11 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dev": true, + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -4033,10 +4119,11 @@ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "node_modules/fs-extra": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", - "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -4245,6 +4332,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-uri": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.3.tgz", + "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==", + "dev": true, + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4", + "fs-extra": "^11.2.0" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/glob": { "version": "10.2.2", "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.2.tgz", @@ -4589,6 +4692,33 @@ "integrity": "sha512-qsh/wKe1Mk1vtYEFr+LpQBFWTO1gxZQBdii2D0Umj+IUQ23r5sT088Rhpq4XzpSyIpaX7vwjB8Rrtx8u9JTg+Q==", "dev": true }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/http2-wrapper": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", @@ -4835,6 +4965,27 @@ "deprecated": "We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser", "dev": true }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true, + "license": "BSD-3-Clause" + }, "node_modules/ip-regex": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", @@ -5911,6 +6062,13 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true, + "license": "MIT" + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -6703,6 +6861,7 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -6712,6 +6871,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -7181,6 +7341,16 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -7560,6 +7730,67 @@ "node": ">=6" } }, + "node_modules/pac-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz", + "integrity": "sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.5", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "dev": true, + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/package-json": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", @@ -7966,6 +8197,63 @@ "node": ">=0.4.0" } }, + "node_modules/proxy-agent": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", + "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.3", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.1", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -8776,6 +9064,71 @@ "node": ">=8" } }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks-proxy-agent/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", diff --git a/package.json b/package.json index 40a8e4e..c46c836 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@wdio/local-runner": "^8.6.7", "@wdio/mocha-framework": "^8.6.6", "@wdio/spec-reporter": "^8.6.6", - "chromedriver": "^111.0.0", + "chromedriver": "^129.0.1", "eslint": "^8.38.0", "eslint-plugin-mocha": "^10.1.0", "eslint-plugin-wdio": "^8.0.14", diff --git a/page.js b/page.js index fd38ded..a76df85 100644 --- a/page.js +++ b/page.js @@ -4,13 +4,34 @@ module.exports = { toField: '#to', phoneNumberField: '#phone', codeField: '#code', + cardNumberField: '#number', + cvvField: '.card-code-input #code', + driverMessage: '#comment', // Buttons callATaxiButton: 'button=Call a taxi', phoneNumberButton: '//div[starts-with(text(), "Phone number")]', nextButton: 'button=Next', confirmButton: 'button=Confirm', + supportivePlanButton: 'div=Supportive', + businessPlanButton: 'div=Business', + paymentMethodButton:'.pp-text', + addCardButton: 'div=Add card', + linkButton: 'button=Link', + cardAdded: 'div=Card', + blanketSwitch: '.switch', + blanketSwitchInput: '.switch-input', + + iceCreamPlusButton: 'div=+', + iceCreamValue: 'div=2', + placeOrderButton: 'smart-button-main=Order', + carSearchButton: '.smart-button', + // Modals - phoneNumberModal: '.modal', + phoneNumberModal: ' .modal', + carSearchModal: 'div=Car search', + driverInfoModal: 'div=Driver info', + + // Functions fillAddresses: async function(from, to) { const fromField = await $(this.fromField); @@ -48,4 +69,5 @@ module.exports = { await codeField.setValue(code) await $(this.confirmButton).click() }, + }; \ No newline at end of file diff --git a/test/specs/createAnOrder.e2e.js b/test/specs/createAnOrder.e2e.js index 0cf60fc..2c64b17 100644 --- a/test/specs/createAnOrder.e2e.js +++ b/test/specs/createAnOrder.e2e.js @@ -2,22 +2,123 @@ const page = require('../../page'); const helper = require('../../helper') describe('Create an order', () => { - it('should open phone number modal', async () => { - await browser.url(`/`) + it('Should set the address', async () => { + await browser.url('/'); await page.fillAddresses('East 2nd Street, 601', '1300 1st St'); - const phoneNumberButton = await $(page.phoneNumberButton); - await phoneNumberButton.waitForDisplayed(); - await phoneNumberButton.click(); - const pnoneNumberModal = await $(page.phoneNumberModal); - await expect(pnoneNumberModal).toBeExisting(); + await expect(await $(page.fromField)).toHaveValue('East 2nd Street, 601'); + await expect(await $(page.toField)).toHaveValue('1300 1st St'); + + }); + + it('Selecting the supportive plan', async () => { + await browser.url('/'); + await page.fillAddresses('East 2nd Street, 601', '1300 1st St'); + const supportivePlanButton = await $(page.supportivePlanButton); + await supportivePlanButton.waitForDisplayed(); + await supportivePlanButton.click(); + await expect(supportivePlanButton.parentElement()).toHaveElementClass('active'); }) - it('should save the phone', async () => { - await browser.url(`/`) + it('Should fill in the phone number', async () => { + await browser.url('/'); await page.fillAddresses('East 2nd Street, 601', '1300 1st St'); const phoneNumber = helper.getPhoneNumber("+1"); await page.submitPhoneNumber(phoneNumber); await expect(await helper.getElementByText(phoneNumber)).toBeExisting(); }) + + it('Adding the credit card info', async () => { + await browser.url('/'); + await page.fillAddresses('East 2nd Street, 601', '1300 1st St'); + const paymentMethodButton = await $(page.paymentMethodButton); + await paymentMethodButton.waitForDisplayed(); + await paymentMethodButton.click(); + const addCardButton = await $(page.addCardButton); + await addCardButton.waitForDisplayed(); + await addCardButton.click(); + const cardNumber = helper.getCardNumber(); + const cvvNumber = helper.getCvvNumber(); + const cardNumberField = await $(page.cardNumberField); + await cardNumberField.setValue(cardNumber); + const cvvField = await $(page.cvvField); + await cvvField.setValue(cvvNumber); + await browser.keys('Tab'); + const linkButton = await $(page.linkButton); + await linkButton.waitForDisplayed(); + await linkButton.click(); + await expect (await $(page.cardAdded)).toBeExisting(); + }) + + it('Leave a message for the driver', async () => { + await browser.url('/'); + await page.fillAddresses('East 2nd Street, 601', '1300 1st St'); + const driverMessage = await $(page.driverMessage); + await driverMessage.setValue('Please arrive on time'); + await expect (driverMessage).toHaveValue('Please arrive on time') + + }) + + it('Should order a blanket and handkerchief', async () => { + await browser.url('/'); + await page.fillAddresses('East 2nd Street, 601', '1300 1st St'); + const supportivePlanButton = await $(page.supportivePlanButton); + await supportivePlanButton.waitForDisplayed(); + await supportivePlanButton.click(); + const blanketSwitch = await $(page.blanketSwitch); + await blanketSwitch.waitForDisplayed(); + await blanketSwitch.click(); + const blanketSwitchInput = await $(page.blanketSwitchInput); + await expect(blanketSwitchInput).toBeChecked(); + + }) + + it('Should order 2 ice creams', async () => { + await browser.url('/'); + await page.fillAddresses('East 2nd Street, 601', '1300 1st St'); + const supportivePlanButton = await $(page.supportivePlanButton); + await supportivePlanButton.click(); + const iceCreamPlusButton = await $(page.iceCreamPlusButton); + await iceCreamPlusButton.waitForDisplayed(); + await iceCreamPlusButton.click(); + await iceCreamPlusButton.click(); + const iceCreamValue = await $(page.iceCreamValue); + await expect (iceCreamValue).toBeExisting(); + +}) + +it('Should display the car search modal', async () => { + await browser.url('/'); + await page.fillAddresses('East 2nd Street, 601', '1300 1st St'); + const businessPlanButton = await $(page.businessPlanButton); + await businessPlanButton.waitForDisplayed(); + await businessPlanButton.click(); + const phoneNumber = helper.getPhoneNumber("+1"); + await page.submitPhoneNumber(phoneNumber); + const carSearchButton = await $(page.carSearchButton); + await carSearchButton.waitForDisplayed(); + await carSearchButton.click(); + const carSearchModal = await $(page.carSearchModal); + await expect(carSearchModal).toBeExisting(); }) +it('Should wait for the driver info to appear in the modal', async () => { + await browser.url('/'); + await page.fillAddresses('East 2nd Street, 601', '1300 1st St'); + const businessPlanButton = await $(page.businessPlanButton); + await businessPlanButton.waitForDisplayed(); + await businessPlanButton.click(); + const carSearchButton = await $(page.carSearchButton); + await carSearchButton.waitForDisplayed(); + await carSearchButton.click(); + await browser.pause(40000); + const driverInfoModal = await $("div*=The driver will arrive"); + await expect(driverInfoModal).toBeExisting(); + +}) + + + + + + +}); \ No newline at end of file diff --git a/wdio.conf.js b/wdio.conf.js index f84964f..cda61bd 100644 --- a/wdio.conf.js +++ b/wdio.conf.js @@ -14,7 +14,7 @@ exports.config = { browserName: 'chrome', acceptInsecureCerts: true, 'goog:chromeOptions': { - args: ['headless', 'disable-gpu'] + //args: ['headless', 'disable-gpu'] } }, { @@ -22,13 +22,13 @@ exports.config = { browserName: 'firefox', acceptInsecureCerts: true, 'moz:firefoxOptions': { - args: ['-headless'] + //args: ['-headless'] } } ], logLevel: 'error', bail: 0, - baseUrl: 'https://e629ed6b-4969-442b-987e-087e81eb10ca.serverhub.practicum-services.com', + baseUrl: 'https://cnt-4a9576f9-0bde-4b43-af3f-ef5f212a3134.containerhub.tripleten-services.com', waitforTimeout: 10000, connectionRetryTimeout: 120000, connectionRetryCount: 3,