Skip to content

Commit 49d8203

Browse files
committed
fix: some improvements
1 parent 536888c commit 49d8203

File tree

10 files changed

+5756
-2937
lines changed

10 files changed

+5756
-2937
lines changed

lib/api/get-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ module.exports = (req, res) => {
1111
file: codeceptjsFactory.getConfigFile(),
1212
config: config.get(),
1313
};
14-
14+
1515
res.json(currentConfig);
1616
};

package-lock.json

Lines changed: 5666 additions & 2858 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@codeceptjs/ui",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"license": "MIT",
55
"scripts": {
6-
"serve": "vue-cli-service serve",
6+
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve --host localhost",
77
"build": "vue-cli-service build",
88
"lint": "vue-cli-service lint --fix && vue-cli-service lint lib/** --fix",
99
"app": "node bin/codecept-ui.js --app -c node_modules/@codeceptjs/examples",
@@ -23,66 +23,66 @@
2323
"build"
2424
],
2525
"dependencies": {
26-
"@codeceptjs/configure": "^0.8.0",
27-
"axios": "^0.24.0",
28-
"body-parser": "^1.20.1",
29-
"cheerio": "^1.0.0-rc.12",
30-
"chokidar": "^3.5.3",
31-
"commander": "^8.3.0",
26+
"@codeceptjs/configure": "0.8.0",
27+
"axios": "1.6.7",
28+
"body-parser": "1.20.1",
29+
"cheerio": "1.0.0-rc.12",
30+
"chokidar": "3.5.3",
31+
"commander": "8.3.0",
3232
"core-js": "2.6.12",
33-
"debug": "^4.3.4",
34-
"electron": "^15.5.5",
35-
"express": "^4.18.2",
36-
"lodash.clonedeep": "^4.5.0",
37-
"nanoid": "^3.3.4",
38-
"socket.io": "^2.3.0",
39-
"socket.io-client": "^2.3.0"
33+
"dayjs": "1.11.10",
34+
"debug": "4.3.4",
35+
"electron": "15.5.5",
36+
"express": "4.18.2",
37+
"lodash.clonedeep": "4.5.0",
38+
"nanoid": "3.3.4",
39+
"socket.io": "2.3.0",
40+
"socket.io-client": "2.3.0"
4041
},
4142
"devDependencies": {
42-
"@codeceptjs/examples": "^1.2.1",
43-
"@medv/finder": "^1.1.3",
44-
"@vue/cli-plugin-babel": "^3.12.1",
45-
"@vue/cli-plugin-eslint": "^3.12.1",
46-
"@vue/cli-service": "^3.12.1",
47-
"@vue/eslint-config-prettier": "^6.0.0",
48-
"ansi-to-html": "^0.7.2",
49-
"ava": "^3.15.0",
50-
"babel-eslint": "^10.1.0",
51-
"buefy": "^0.9.13",
52-
"codeceptjs": "^3.4.0",
53-
"contributor-faces": "^1.1.0",
54-
"copy-text-to-clipboard": "^3.0.1",
55-
"electron-icon-builder": "^2.0.1",
56-
"eslint": "^7.32.0",
57-
"eslint-plugin-vue": "^7.20.0",
58-
"husky": "^7.0.4",
59-
"lint-staged": "^11.2.6",
60-
"moment": "^2.29.4",
61-
"playwright": "^1.29",
62-
"prismjs": "^1.29.0",
63-
"puppeteer": "^10.4.0",
64-
"qrcode-terminal": "^0.12.0",
65-
"sass": "^1.57.1",
66-
"sass-loader": "^10.2.0",
67-
"tailwindcss": "^1.9.6",
68-
"testcafe": "^1.20.1",
69-
"uuid": "^8.3.2",
70-
"vue": "^2.6.14",
43+
"@codeceptjs/examples": "1.2.1",
44+
"@medv/finder": "1.1.3",
45+
"@vue/cli-plugin-babel": "3.12.1",
46+
"@vue/cli-plugin-eslint": "3.12.1",
47+
"@vue/cli-service": "3.12.1",
48+
"@vue/eslint-config-prettier": "6.0.0",
49+
"ansi-to-html": "0.7.2",
50+
"ava": "3.15.0",
51+
"babel-eslint": "10.1.0",
52+
"buefy": "0.9.13",
53+
"codeceptjs": "3.4.0",
54+
"contributor-faces": "1.1.0",
55+
"copy-text-to-clipboard": "3.0.1",
56+
"electron-icon-builder": "2.0.1",
57+
"eslint": "7.32.0",
58+
"eslint-plugin-vue": "7.20.0",
59+
"husky": "7.0.4",
60+
"lint-staged": "11.2.6",
61+
"playwright": "1.29",
62+
"prismjs": "1.29.0",
63+
"puppeteer": "10.4.0",
64+
"qrcode-terminal": "0.12.0",
65+
"sass": "1.57.1",
66+
"sass-loader": "10.2.0",
67+
"tailwindcss": "1.9.6",
68+
"testcafe": "1.20.1",
69+
"uuid": "8.3.2",
70+
"vue": "2.6.14",
7171
"vue-cli-plugin-electron-builder": "~2.1.1",
72-
"vue-highlightjs": "^1.3.3",
73-
"vue-monaco": "^1.2.2",
74-
"vue-prism-editor": "^1.3.0",
75-
"vue-router": "^3.5.3",
76-
"vue-socket.io": "^3.0.10",
72+
"vue-highlightjs": "1.3.3",
73+
"vue-monaco": "1.2.2",
74+
"vue-prism-editor": "1.3.0",
75+
"vue-router": "3.5.3",
76+
"vue-socket.io": "3.0.10",
7777
"vue-template-compiler": "2.6.14",
78-
"vuex": "^3.6.2",
79-
"webdriverio": "^7.24.0"
78+
"vuex": "3.6.2",
79+
"webdriverio": "7.24.0"
8080
},
8181
"resolutions": {
8282
"sumchecker": "3.0.1"
8383
},
8484
"peerDependencies": {
85-
"codeceptjs": "^3.2.2"
85+
"codeceptjs": "3.5.12"
8686
},
8787
"eslintConfig": {
8888
"root": true,

src/components/Feature.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747

4848
<script>
4949
import axios from 'axios';
50-
import moment from 'moment';
5150
import EditorNotFound from './EditorNotFound';
5251
import Scenario from './Scenario';
52+
import dayjs from 'dayjs';
53+
import relativeTime from 'dayjs/plugin/relativeTime';
54+
dayjs.extend(relativeTime);
5355
5456
export default {
5557
name: 'Feature',
@@ -69,7 +71,7 @@ export default {
6971
},
7072
methods: {
7173
humanize(ts) {
72-
return moment.unix(ts / 1000).fromNow();
74+
return dayjs(ts).fromNow();
7375
},
7476
7577
openInEditor(file) {

src/components/Scenario.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
</template>
6464

6565
<script>
66-
import moment from 'moment';
66+
import dayjs from 'dayjs';
67+
import relativeTime from 'dayjs/plugin/relativeTime';
68+
dayjs.extend(relativeTime);
6769
6870
export default {
6971
name: 'Scenario',
@@ -115,7 +117,7 @@ export default {
115117
},
116118
methods: {
117119
humanize(ts) {
118-
return moment.unix(ts / 1000).fromNow();
120+
return dayjs(ts).fromNow();
119121
},
120122
121123
selectScenario(scenario) {

src/components/SettingsMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class="fa-md fas fa-edit text-red-500 mr-2 fa-inverse"
1919
v-if="!editor"
2020
/>
21-
</b-tooltip>
21+
</b-tooltip>
2222
<b-tooltip
2323
label="Window Mode Enabled"
2424
position="is-left"
@@ -153,7 +153,7 @@
153153
<a
154154
class="is-small"
155155
@click="gotoSettingsPage()"
156-
>Show Config</a> &nbsp; {{ config.file }}
156+
>Show CodeceptJS Config</a>
157157
</footer>
158158
</div>
159159
</form>

src/components/SnapshotSource.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default {
9292
return (
9393
this.$refs.contentDocument ||
9494
(this.$refs.source.contentWindow &&
95-
this.$refs.source.contentWindow.document)
95+
this.$refs.source.contentWindow.document)
9696
);
9797
},
9898
@@ -105,7 +105,7 @@ export default {
105105
return (
106106
this.$refs.source.contentWindow &&
107107
(this.$props.snapshot.scrollPosition.x > 0 ||
108-
this.$props.snapshot.scrollPosition.y > 0)
108+
this.$props.snapshot.scrollPosition.y > 0)
109109
);
110110
},
111111

src/components/Test.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,13 @@
103103
</template>
104104

105105
<script>
106-
import moment from 'moment';
106+
import relativeTime from 'dayjs/plugin/relativeTime';
107107
import Pause from './Pause';
108108
import Step from './Step';
109109
import ScenarioSource from './ScenarioSource';
110110
import TestResult from './TestResult';
111+
import dayjs from 'dayjs';
112+
dayjs.extend(relativeTime);
111113
112114
export default {
113115
name: 'Test',
@@ -137,7 +139,7 @@ export default {
137139
138140
methods: {
139141
humanize(ts) {
140-
return moment.unix(ts / 1000).fromNow();
142+
return dayjs(ts).fromNow();
141143
},
142144
143145
indentLevel(step) {

src/components/pages/NewTestPage.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
@run="runScenario(scenario)"
66
/>
77
<aside class="Sidebar">
8-
<MonacoEditor
8+
<MonacoEditor
99
class="editor"
10-
v-model="code"
10+
v-model="code"
1111
@editorDidMount="editorDidMount"
12-
language="javascript"
12+
language="javascript"
1313
/>
14-
14+
1515
<button
1616
v-if="!isRunning"
1717
@click="runScenario(scenario)"
@@ -55,7 +55,7 @@
5555
<a @click="enableWindowMode()">Force Window mode <i class="fas fa-window-maximize settings" /></a> to see the execution in actual browser
5656
</li>
5757
<li :class="{ 'line-through': isSingleSession }">
58-
<a @click="enableSingleSession()">Enable Singleton Browser Session</a> to reuse one window accross test runs
58+
<a @click="enableSingleSession()">Enable Singleton Browser Session</a> to reuse one window across test runs
5959
</li>
6060
<li :class="{ 'line-through': isRunning }">
6161
Write the inital code and click <a @click="runScenario()">Launch Test</a>
@@ -109,7 +109,7 @@ export default {
109109
created: async function () {
110110
this.$store.dispatch('testRuns/clearTests');
111111
if (localStorage.getItem('newTestCommand') !== null) {
112-
this.code = localStorage.getItem('newTestCommand');
112+
this.code = localStorage.getItem('newTestCommand');
113113
}
114114
},
115115
beforeDestroy: function() {

src/components/pages/PageObjectsPage.vue

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
<SettingsMenu />
1616
</b-navbar-item>
1717
</template>
18-
<template slot="start">
19-
20-
</template>
18+
<template slot="start" />
2119

2220
<template slot="end">
2321
<b-navbar-item class="is-hidden-touch">
@@ -31,20 +29,27 @@
3129
>
3230
<aside class="Sidebar">
3331
<div>
34-
<h1 class="title is-size-4 has-text-grey-dark">Page Objects</h1>
35-
<br />
32+
<h1 class="title is-size-4 has-text-grey-dark">
33+
Page Objects
34+
</h1>
35+
<br>
3636
</div>
3737
<ul style="overflow-y: scroll;">
3838
<li v-for="(value,name) in pageObject">
39-
<a class="Scenario-detailLink" @click="loadPageObjectSource(value.source)">{{ name }}
40-
<i class="fas fa-angle-right"></i>
39+
<a
40+
class="Scenario-detailLink"
41+
@click="loadPageObjectSource(value.source)"
42+
>{{ name }}
43+
<i class="fas fa-angle-right" />
4144
</a>
4245
</li>
4346
</ul>
44-
4547
</aside>
46-
<div class="Content" style="overflow-y: scroll;">
47-
<pre v-highlightjs="pageObjectSource"><code class="javascript"/></pre>
48+
<div
49+
class="Content"
50+
style="overflow-y: scroll;"
51+
>
52+
<pre v-highlightjs="pageObjectSource"><code class="javascript" /></pre>
4853
</div>
4954
</section>
5055
</div>

0 commit comments

Comments
 (0)