plum-e2e 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plum-e2e",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/silverlunah/plum.git"
@@ -11,7 +11,9 @@
11
11
  "init": "(npm install) && (cd backend && npm install && npm run create-env && node config/scripts/create-settings.js) && (cd ../frontend && npm install && echo 'Frontend install complete')",
12
12
  "format": "prettier --write .",
13
13
  "add-license": "npx license-check-and-add add -f license-config.json",
14
- "prepare": "husky"
14
+ "prepare": "husky",
15
+ "docker:up": "docker compose up -d --build",
16
+ "docker:down": "docker compose down"
15
17
  },
16
18
  "keywords": [],
17
19
  "bin": {
@@ -1,22 +0,0 @@
1
- const { SAMPLE_CONSTANT } = require('../utils/constants');
2
- const Utils = require('../utils/utils');
3
-
4
- class LoginPage {
5
- constructor(page) {
6
- this.page = page;
7
- this.utils = new Utils(this.page);
8
- }
9
-
10
- async goToLoginPage() {
11
- console.log(SAMPLE_CONSTANT);
12
- await this.utils.goToPage(process.env.BASE_URL);
13
- await this.page.waitForTimeout(3000);
14
- throw Error();
15
- }
16
-
17
- async skipTest() {
18
- test.skip();
19
- }
20
- }
21
-
22
- module.exports = LoginPage;
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- SAMPLE_CONSTANT: 'this is a constant'
3
- };
@@ -1,65 +0,0 @@
1
- /*
2
- * This file is part of Plum.
3
- *
4
- * Plum is free software: you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation, either version 3 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * Plum is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with Plum. If not, see https://www.gnu.org/licenses/.
16
- */
17
-
18
- require('dotenv').config();
19
-
20
- const { Before, After, setWorldConstructor } = require('@cucumber/cucumber');
21
- const { chromium } = require('playwright');
22
- const fs = require('fs');
23
- const path = require('path');
24
- const Utils = require('../utils/utils');
25
- const LoginPage = require('../pages/LoginPage');
26
-
27
- class CustomWorld {
28
- constructor({ attach }) {
29
- // Enable attaching files to reports
30
- this.attach = attach;
31
-
32
- // Instance
33
- this.browser = null;
34
- this.context = null;
35
- this.page = null;
36
-
37
- // Pages
38
- this.loginPage = null;
39
- this.utils = null;
40
- }
41
- }
42
-
43
- setWorldConstructor(CustomWorld);
44
-
45
- Before(async function () {
46
- this.browser = await chromium.launch({ headless: process.env.IS_HEADLESS === 'true' });
47
- this.context = await this.browser.newContext();
48
- this.page = await this.context.newPage();
49
- this.loginPage = new LoginPage(this.page);
50
- this.utils = new Utils(this.page);
51
- });
52
-
53
- After(async function (scenario) {
54
- if (scenario.result.status === 'FAILED') {
55
- const screenshotPath = path.join('reports/screenshots', `screenshot_${Date.now()}.png`);
56
- await this.page.screenshot({ path: screenshotPath });
57
-
58
- // Attach screenshot to the Cucumber report
59
- const screenshotData = fs.readFileSync(screenshotPath);
60
- this.attach(screenshotData, 'image/png');
61
- }
62
-
63
- // Close the browser after each test
64
- await this.browser.close();
65
- });
@@ -1,10 +0,0 @@
1
- class Utils {
2
- constructor(page) {
3
- this.page = page;
4
- }
5
- async goToPage(url) {
6
- await this.page.goto(url);
7
- }
8
- }
9
-
10
- module.exports = Utils;