Skip to content

Commit 45a7ade

Browse files
authored
Merge pull request #1 from Bahmni/feature/framework-dev
Initial commit
2 parents 68e9c6f + e32d50a commit 45a7ade

File tree

17 files changed

+2738
-0
lines changed

17 files changed

+2738
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mochawesome-report
2+
node_modules

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
yarn lint
2+
yarn format:check
3+
talisman --githook pre-commit

.mocharc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"spec": "tests/**/*.spec.js",
3+
"extension": ["js"],
4+
"file": ["tests/fixtures/rootHooks.js"],
5+
"reporter": "mochawesome",
6+
"reporterOptions": {
7+
"reportDir": "./reports/json",
8+
"reportFilename": "testresult",
9+
"inline": true,
10+
"charts": true,
11+
"saveJson": true,
12+
"saveHtml": false,
13+
"overwrite": true,
14+
"quiet": true
15+
}
16+
}

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
mochawesome_report
3+
.vscode

eslint.config.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import js from "@eslint/js";
2+
import mochaPlugin from "eslint-plugin-mocha";
3+
import prettierPlugin from "eslint-plugin-prettier";
4+
import nodePlugin from "eslint-plugin-node";
5+
6+
export default [
7+
{
8+
ignores: [
9+
"node_modules/**",
10+
"mochawesome-report/**",
11+
".vscode/**",
12+
"eslint.config.js",
13+
"*.log"]
14+
},
15+
{
16+
languageOptions: {
17+
globals: {
18+
global: "readonly"
19+
}
20+
}
21+
},
22+
js.configs.recommended,
23+
{
24+
files: ["**/*.js"],
25+
ignores: ["node_modules/**", "mochawesome-report/**", ".vscode/**", "*.log", "eslint.config.js"],
26+
languageOptions: {
27+
ecmaVersion: 2021,
28+
sourceType: "module",
29+
globals: {
30+
describe: "readonly",
31+
it: "readonly",
32+
before: "readonly",
33+
after: "readonly",
34+
beforeEach: "readonly",
35+
afterEach: "readonly",
36+
global: "readonly"
37+
}
38+
},
39+
plugins: {
40+
mocha: mochaPlugin,
41+
prettier: prettierPlugin,
42+
node: nodePlugin
43+
},
44+
rules: {
45+
"no-unused-vars": ["warn"],
46+
"no-console": "off",
47+
"mocha/no-exclusive-tests": "error",
48+
"node/no-unsupported-features/es-syntax": [
49+
"error",
50+
{ ignores: ["modules"] }
51+
],
52+
"prettier/prettier": "warn",
53+
}
54+
},
55+
{
56+
files: ["tests/specs/**/*.js"],
57+
rules: {
58+
"func-names": "off"
59+
}
60+
}
61+
];

jsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"checkJs": false,
4+
"allowJs": true,
5+
},
6+
"include": [
7+
"src/**/*.js",
8+
"tests/**/*.js",
9+
"tests/fixtures/globals.d.ts"
10+
]
11+
}

package.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "systemx-apitest-automation",
3+
"version": "1.0.0",
4+
"description": "",
5+
"type": "module",
6+
"main": "index.js",
7+
"scripts": {
8+
"test": "mocha --config .mocharc.json",
9+
"prepare": "husky",
10+
"lint": "eslint .",
11+
"lint:fix": "eslint . --fix",
12+
"format:check": "prettier --check .",
13+
"format": "prettier --write ."
14+
},
15+
"keywords": [],
16+
"author": "IOM",
17+
"license": "MPL-2.0",
18+
"devDependencies": {
19+
"@eslint/eslintrc": "^3.3.1",
20+
"@eslint/js": "^9.36.0",
21+
"@types/chai": "^5.2.2",
22+
"chai": "^6.0.1",
23+
"chai-as-promised": "^8.0.2",
24+
"eslint": "^9.36.0",
25+
"eslint-config-prettier": "^10.1.8",
26+
"eslint-plugin-chai-expect": "^3.1.0",
27+
"eslint-plugin-chai-friendly": "^1.1.0",
28+
"eslint-plugin-import": "^2.32.0",
29+
"eslint-plugin-mocha": "^11.1.0",
30+
"eslint-plugin-node": "^11.1.0",
31+
"eslint-plugin-prettier": "^5.5.4",
32+
"eslint-plugin-promise": "^7.2.1",
33+
"eslint-plugin-security": "^3.0.1",
34+
"husky": "^9.1.7",
35+
"mocha": "^11.7.2",
36+
"mochawesome": "^7.1.4",
37+
"mochawesome-merge": "^5.0.0",
38+
"mochawesome-report-generator": "^6.3.0",
39+
"prettier": "^3.6.2",
40+
"supertest": "^7.1.4"
41+
}
42+
}

src/config/apiClient.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import supertest from "supertest";
2+
import { config } from "../config/index.js";
3+
4+
export function request() {
5+
return supertest(config.baseURI);
6+
}

src/config/environments.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export let environments = {
2+
dev: {
3+
baseUri: "https://gorest.co.in/",
4+
userName: "",
5+
password: ""
6+
},
7+
qa: {
8+
baseUri: "",
9+
userName: "",
10+
password: ""
11+
},
12+
uat: {
13+
baseUri: "",
14+
userName: "",
15+
password: ""
16+
}
17+
}

0 commit comments

Comments
 (0)