Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElectricitySheep
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄媛媛
ElectricitySheep
Commits
40097aea
Commit
40097aea
authored
Apr 21, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
973b31a9
Pipeline
#56
canceled with stages
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
7 additions
and
292 deletions
+7
-292
App.vue
src/App.vue
+0
-1
HelloWorld.vue
src/components/HelloWorld.vue
+7
-100
elementCount.js
test/e2e/custom-assertions/elementCount.js
+0
-27
nightwatch.conf.js
test/e2e/nightwatch.conf.js
+0
-46
runner.js
test/e2e/runner.js
+0
-48
test.js
test/e2e/specs/test.js
+0
-19
.eslintrc
test/unit/.eslintrc
+0
-7
jest.conf.js
test/unit/jest.conf.js
+0
-30
setup.js
test/unit/setup.js
+0
-3
HelloWorld.spec.js
test/unit/specs/HelloWorld.spec.js
+0
-11
No files found.
src/App.vue
View file @
40097aea
<
template
>
<div
id=
"app"
>
<img
src=
"./assets/logo.png"
>
<router-view/>
</div>
</
template
>
...
...
src/components/HelloWorld.vue
View file @
40097aea
<
template
>
<div
class=
"hello"
>
<h1>
{{
msg
}}
</h1>
<h2>
Essential Links
</h2>
<ul>
<li>
<a
href=
"https://vuejs.org"
target=
"_blank"
>
Core Docs
</a>
</li>
<li>
<a
href=
"https://forum.vuejs.org"
target=
"_blank"
>
Forum
</a>
</li>
<li>
<a
href=
"https://chat.vuejs.org"
target=
"_blank"
>
Community Chat
</a>
</li>
<li>
<a
href=
"https://twitter.com/vuejs"
target=
"_blank"
>
Twitter
</a>
</li>
<br>
<li>
<a
href=
"http://vuejs-templates.github.io/webpack/"
target=
"_blank"
>
Docs for This Template
</a>
</li>
</ul>
<h2>
Ecosystem
</h2>
<ul>
<li>
<a
href=
"http://router.vuejs.org/"
target=
"_blank"
>
vue-router
</a>
</li>
<li>
<a
href=
"http://vuex.vuejs.org/"
target=
"_blank"
>
vuex
</a>
</li>
<li>
<a
href=
"http://vue-loader.vuejs.org/"
target=
"_blank"
>
vue-loader
</a>
</li>
<li>
<a
href=
"https://github.com/vuejs/awesome-vue"
target=
"_blank"
>
awesome-vue
</a>
</li>
</ul>
</div>
<div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'
HelloWorld
'
,
name
:
'
Login
'
,
data
()
{
return
{
msg
:
'
Welcome to Your Vue.js App
'
msg
:
''
}
}
}
</
script
>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<
style
scoped
>
h1
,
h2
{
font-weight
:
normal
;
}
ul
{
list-style-type
:
none
;
padding
:
0
;
}
li
{
display
:
inline-block
;
margin
:
0
10px
;
}
a
{
color
:
#42b983
;
}
<
style
>
</
style
>
test/e2e/custom-assertions/elementCount.js
deleted
100644 → 0
View file @
973b31a9
// A custom Nightwatch assertion.
// The assertion name is the filename.
// Example usage:
//
// browser.assert.elementCount(selector, count)
//
// For more information on custom assertions see:
// http://nightwatchjs.org/guide#writing-custom-assertions
exports
.
assertion
=
function
(
selector
,
count
)
{
this
.
message
=
'Testing if element <'
+
selector
+
'> has count: '
+
count
this
.
expected
=
count
this
.
pass
=
function
(
val
)
{
return
val
===
this
.
expected
}
this
.
value
=
function
(
res
)
{
return
res
.
value
}
this
.
command
=
function
(
cb
)
{
var
self
=
this
return
this
.
api
.
execute
(
function
(
selector
)
{
return
document
.
querySelectorAll
(
selector
).
length
},
[
selector
],
function
(
res
)
{
cb
.
call
(
self
,
res
)
})
}
}
test/e2e/nightwatch.conf.js
deleted
100644 → 0
View file @
973b31a9
require
(
'babel-register'
)
var
config
=
require
(
'../../config'
)
// http://nightwatchjs.org/gettingstarted#settings-file
module
.
exports
=
{
src_folders
:
[
'test/e2e/specs'
],
output_folder
:
'test/e2e/reports'
,
custom_assertions_path
:
[
'test/e2e/custom-assertions'
],
selenium
:
{
start_process
:
true
,
server_path
:
require
(
'selenium-server'
).
path
,
host
:
'127.0.0.1'
,
port
:
4444
,
cli_args
:
{
'webdriver.chrome.driver'
:
require
(
'chromedriver'
).
path
}
},
test_settings
:
{
default
:
{
selenium_port
:
4444
,
selenium_host
:
'localhost'
,
silent
:
true
,
globals
:
{
devServerURL
:
'http://localhost:'
+
(
process
.
env
.
PORT
||
config
.
dev
.
port
)
}
},
chrome
:
{
desiredCapabilities
:
{
browserName
:
'chrome'
,
javascriptEnabled
:
true
,
acceptSslCerts
:
true
}
},
firefox
:
{
desiredCapabilities
:
{
browserName
:
'firefox'
,
javascriptEnabled
:
true
,
acceptSslCerts
:
true
}
}
}
}
test/e2e/runner.js
deleted
100644 → 0
View file @
973b31a9
// 1. start the dev server using production config
process
.
env
.
NODE_ENV
=
'testing'
const
webpack
=
require
(
'webpack'
)
const
DevServer
=
require
(
'webpack-dev-server'
)
const
webpackConfig
=
require
(
'../../build/webpack.prod.conf'
)
const
devConfigPromise
=
require
(
'../../build/webpack.dev.conf'
)
let
server
devConfigPromise
.
then
(
devConfig
=>
{
const
devServerOptions
=
devConfig
.
devServer
const
compiler
=
webpack
(
webpackConfig
)
server
=
new
DevServer
(
compiler
,
devServerOptions
)
const
port
=
devServerOptions
.
port
const
host
=
devServerOptions
.
host
return
server
.
listen
(
port
,
host
)
})
.
then
(()
=>
{
// 2. run the nightwatch test suite against it
// to run in additional browsers:
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
// 2. add it to the --env flag below
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
// For more information on Nightwatch's config file, see
// http://nightwatchjs.org/guide#settings-file
let
opts
=
process
.
argv
.
slice
(
2
)
if
(
opts
.
indexOf
(
'--config'
)
===
-
1
)
{
opts
=
opts
.
concat
([
'--config'
,
'test/e2e/nightwatch.conf.js'
])
}
if
(
opts
.
indexOf
(
'--env'
)
===
-
1
)
{
opts
=
opts
.
concat
([
'--env'
,
'chrome'
])
}
const
spawn
=
require
(
'cross-spawn'
)
const
runner
=
spawn
(
'./node_modules/.bin/nightwatch'
,
opts
,
{
stdio
:
'inherit'
})
runner
.
on
(
'exit'
,
function
(
code
)
{
server
.
close
()
process
.
exit
(
code
)
})
runner
.
on
(
'error'
,
function
(
err
)
{
server
.
close
()
throw
err
})
})
test/e2e/specs/test.js
deleted
100644 → 0
View file @
973b31a9
// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage
module
.
exports
=
{
'default e2e tests'
:
function
(
browser
)
{
// automatically uses dev Server port from /config.index.js
// default: http://localhost:8080
// see nightwatch.conf.js
const
devServer
=
browser
.
globals
.
devServerURL
browser
.
url
(
devServer
)
.
waitForElementVisible
(
'#app'
,
5000
)
.
assert
.
elementPresent
(
'.hello'
)
.
assert
.
containsText
(
'h1'
,
'Welcome to Your Vue.js App'
)
.
assert
.
elementCount
(
'img'
,
1
)
.
end
()
}
}
test/unit/.eslintrc
deleted
100644 → 0
View file @
973b31a9
{
"env": {
"jest": true
},
"globals": {
}
}
test/unit/jest.conf.js
deleted
100644 → 0
View file @
973b31a9
const
path
=
require
(
'path'
)
module
.
exports
=
{
rootDir
:
path
.
resolve
(
__dirname
,
'../../'
),
moduleFileExtensions
:
[
'js'
,
'json'
,
'vue'
],
moduleNameMapper
:
{
'^@/(.*)$'
:
'<rootDir>/src/$1'
},
transform
:
{
'^.+
\\
.js$'
:
'<rootDir>/node_modules/babel-jest'
,
'.*
\\
.(vue)$'
:
'<rootDir>/node_modules/vue-jest'
},
testPathIgnorePatterns
:
[
'<rootDir>/test/e2e'
],
snapshotSerializers
:
[
'<rootDir>/node_modules/jest-serializer-vue'
],
setupFiles
:
[
'<rootDir>/test/unit/setup'
],
mapCoverage
:
true
,
coverageDirectory
:
'<rootDir>/test/unit/coverage'
,
collectCoverageFrom
:
[
'src/**/*.{js,vue}'
,
'!src/main.js'
,
'!src/router/index.js'
,
'!**/node_modules/**'
]
}
test/unit/setup.js
deleted
100644 → 0
View file @
973b31a9
import
Vue
from
'vue'
Vue
.
config
.
productionTip
=
false
test/unit/specs/HelloWorld.spec.js
deleted
100644 → 0
View file @
973b31a9
import
Vue
from
'vue'
import
HelloWorld
from
'@/components/HelloWorld'
describe
(
'HelloWorld.vue'
,
()
=>
{
it
(
'should render correct contents'
,
()
=>
{
const
Constructor
=
Vue
.
extend
(
HelloWorld
)
const
vm
=
new
Constructor
().
$mount
()
expect
(
vm
.
$el
.
querySelector
(
'.hello h1'
).
textContent
)
.
toEqual
(
'Welcome to Your Vue.js App'
)
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment