use the tsconfig file:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"inlineSourceMap": false,
"declaration": false,
"noImplicitAny": false,
"outDir": "../FinalFramework",
"rootDir": "../Protractor_UI_Framework/",
"allowJs": true
},
"include": ["**/*","conf.js"],
"exclude": [
"node_modules",
"asyncAwait",
"plugins.ts"
]
}
Package.json:
{
"name": "Test project",
"version": "1.0.0",
"description": "Test framework for test project",
"main": "conf.js",
"keywords": [
"test"
],
"author": "Praveen David Mathew",
"license": "ISC",
"dependencies": {
"@types/node": "^12.12.14",
"fs-extra": "^8.1.0",
"jasmine-reporters": "^2.3.2",
"jasmine-spec-reporter": "^4.2.1",
"protractor": "^5.4.2",
"protractor-html-reporter-2": "^1.0.4",
"protractor-image-comparison": "^3.5.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.8",
"windows-shortcuts": "^0.1.6"
},
"scripts": {
"tsc": "tsc", "remove":"rmdir \"../FinalFramework\" /S /Q", "compile":"npm run tsc", "copyBathFile":"copy \"start.bat\" \"../FinalFramework/test.bat\"", "copyPackageJson":"copy \"package.json\" \"../FinalFramework/package.json\"", "installDependencies":"cd ../FinalFramework/ && npm install", "build": "run-s remove compile copyBathFile copyPackageJson installDependencies", "pretest": "run-s build", "test": "cd ../FinalFramework/ && test.bat" },
"devDependencies": {
"@types/jasmine": "^3.5.0",
"@types/jasminewd2": "^2.0.8",
"protractor-beautiful-reporter": "^1.3.5"
}
}
Use below line in protractor files:
import {browser, element, by, By, $, $$, protractor} from 'protractor';