Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Frank Cardillo - SDET Candidate #94

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .eslintignore
Empty file.
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": true,
"parserOptions": {"parser": "babel-eslint"},
"extends": [
"plugin:vue/recommended"
],
"plugins": ["webdriverio"],
"env": {
"webdriverio/wdio": true,
"mocha": true
}
}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# force-vue-awakens
#
Frank Cardillo's work as an SDET candidate

## force-vue-awakens
> Every generation has a story

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"e2e": "wdio",
"build": "webpack",
"start": "webpack-dev-server",
"lint": "eslint src test wdio.conf.js"
"lint": "eslint --ext .js,.vue src test"
},
"author": "Ian Walter <[email protected]> (https://iankwalter.com)",
"dependencies": {
Expand Down
16 changes: 5 additions & 11 deletions src/components/Home.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
<template>
<div class="container pt-4 pb-4">

<section>

<h2>People</h2>

<div class="d-flex flex-wrap">
<router-link
v-for="(person, id) in results"
:to="`/people/${id}`"
:key="id"
:to="`/people/${id}`"
class="card m-2"
style="width: 12rem;">

style="width: 12rem;"
>
<img
:src="`https://starwars-visualguide.com/assets/img/characters/${id + 1}.jpg`"
class="card-img-top"
alt="Card image cap">
alt="Card image cap"
>

<div class="card-body">

<h5 class="card-title m-0">
{{ person.name }}
</h5>

</div>

</router-link>
</div>

</section>

</div>
</template>

Expand Down
3 changes: 3 additions & 0 deletions src/components/PageNotFound.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<div>404! Page Not Found! Go Back!</div>
</template>
4 changes: 3 additions & 1 deletion src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Vue.use(VueRouter)

const Home = () => import('@/components/Home')
const Person = () => import('@/components/Person')
const PageNotFound = () => import('@/components/PageNotFound')

// Export a new Vue Router instance to be used in the application.
export default new VueRouter({
Expand All @@ -17,6 +18,7 @@ export default new VueRouter({
{
path: '/people/:id',
component: Vue.component('Person', Person)
}
},
{ path: '*', component: Vue.component('PageNotFound', PageNotFound) }
]
})
278 changes: 278 additions & 0 deletions test/data/swapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
{
"count": 87,
"next": "https://swapi.co/api/people/?page=2",
"previous": null,
"results": [
{
"name": "Luke Skywalker",
"height": "172",
"mass": "77",
"hair_color": "blond",
"skin_color": "fair",
"eye_color": "blue",
"birth_year": "19BBY",
"gender": "male",
"homeworld": "https://swapi.co/api/planets/1/",
"films": [
"https://swapi.co/api/films/2/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/3/",
"https://swapi.co/api/films/1/",
"https://swapi.co/api/films/7/"
],
"species": [
"https://swapi.co/api/species/1/"
],
"vehicles": [
"https://swapi.co/api/vehicles/14/",
"https://swapi.co/api/vehicles/30/"
],
"starships": [
"https://swapi.co/api/starships/12/",
"https://swapi.co/api/starships/22/"
],
"created": "2014-12-09T13:50:51.644000Z",
"edited": "2014-12-20T21:17:56.891000Z",
"url": "https://swapi.co/api/people/1/"
},
{
"name": "C-3PO",
"height": "167",
"mass": "75",
"hair_color": "n/a",
"skin_color": "gold",
"eye_color": "yellow",
"birth_year": "112BBY",
"gender": "n/a",
"homeworld": "https://swapi.co/api/planets/1/",
"films": [
"https://swapi.co/api/films/2/",
"https://swapi.co/api/films/5/",
"https://swapi.co/api/films/4/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/3/",
"https://swapi.co/api/films/1/"
],
"species": [
"https://swapi.co/api/species/2/"
],
"vehicles": [],
"starships": [],
"created": "2014-12-10T15:10:51.357000Z",
"edited": "2014-12-20T21:17:50.309000Z",
"url": "https://swapi.co/api/people/2/"
},
{
"name": "R2-D2",
"height": "96",
"mass": "32",
"hair_color": "n/a",
"skin_color": "white, blue",
"eye_color": "red",
"birth_year": "33BBY",
"gender": "n/a",
"homeworld": "https://swapi.co/api/planets/8/",
"films": [
"https://swapi.co/api/films/2/",
"https://swapi.co/api/films/5/",
"https://swapi.co/api/films/4/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/3/",
"https://swapi.co/api/films/1/",
"https://swapi.co/api/films/7/"
],
"species": [
"https://swapi.co/api/species/2/"
],
"vehicles": [],
"starships": [],
"created": "2014-12-10T15:11:50.376000Z",
"edited": "2014-12-20T21:17:50.311000Z",
"url": "https://swapi.co/api/people/3/"
},
{
"name": "Darth Vader",
"height": "202",
"mass": "136",
"hair_color": "none",
"skin_color": "white",
"eye_color": "yellow",
"birth_year": "41.9BBY",
"gender": "male",
"homeworld": "https://swapi.co/api/planets/1/",
"films": [
"https://swapi.co/api/films/2/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/3/",
"https://swapi.co/api/films/1/"
],
"species": [
"https://swapi.co/api/species/1/"
],
"vehicles": [],
"starships": [
"https://swapi.co/api/starships/13/"
],
"created": "2014-12-10T15:18:20.704000Z",
"edited": "2014-12-20T21:17:50.313000Z",
"url": "https://swapi.co/api/people/4/"
},
{
"name": "Leia Organa",
"height": "150",
"mass": "49",
"hair_color": "brown",
"skin_color": "light",
"eye_color": "brown",
"birth_year": "19BBY",
"gender": "female",
"homeworld": "https://swapi.co/api/planets/2/",
"films": [
"https://swapi.co/api/films/2/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/3/",
"https://swapi.co/api/films/1/",
"https://swapi.co/api/films/7/"
],
"species": [
"https://swapi.co/api/species/1/"
],
"vehicles": [
"https://swapi.co/api/vehicles/30/"
],
"starships": [],
"created": "2014-12-10T15:20:09.791000Z",
"edited": "2014-12-20T21:17:50.315000Z",
"url": "https://swapi.co/api/people/5/"
},
{
"name": "Owen Lars",
"height": "178",
"mass": "120",
"hair_color": "brown, grey",
"skin_color": "light",
"eye_color": "blue",
"birth_year": "52BBY",
"gender": "male",
"homeworld": "https://swapi.co/api/planets/1/",
"films": [
"https://swapi.co/api/films/5/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/1/"
],
"species": [
"https://swapi.co/api/species/1/"
],
"vehicles": [],
"starships": [],
"created": "2014-12-10T15:52:14.024000Z",
"edited": "2014-12-20T21:17:50.317000Z",
"url": "https://swapi.co/api/people/6/"
},
{
"name": "Beru Whitesun lars",
"height": "165",
"mass": "75",
"hair_color": "brown",
"skin_color": "light",
"eye_color": "blue",
"birth_year": "47BBY",
"gender": "female",
"homeworld": "https://swapi.co/api/planets/1/",
"films": [
"https://swapi.co/api/films/5/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/1/"
],
"species": [
"https://swapi.co/api/species/1/"
],
"vehicles": [],
"starships": [],
"created": "2014-12-10T15:53:41.121000Z",
"edited": "2014-12-20T21:17:50.319000Z",
"url": "https://swapi.co/api/people/7/"
},
{
"name": "R5-D4",
"height": "97",
"mass": "32",
"hair_color": "n/a",
"skin_color": "white, red",
"eye_color": "red",
"birth_year": "unknown",
"gender": "n/a",
"homeworld": "https://swapi.co/api/planets/1/",
"films": [
"https://swapi.co/api/films/1/"
],
"species": [
"https://swapi.co/api/species/2/"
],
"vehicles": [],
"starships": [],
"created": "2014-12-10T15:57:50.959000Z",
"edited": "2014-12-20T21:17:50.321000Z",
"url": "https://swapi.co/api/people/8/"
},
{
"name": "Biggs Darklighter",
"height": "183",
"mass": "84",
"hair_color": "black",
"skin_color": "light",
"eye_color": "brown",
"birth_year": "24BBY",
"gender": "male",
"homeworld": "https://swapi.co/api/planets/1/",
"films": [
"https://swapi.co/api/films/1/"
],
"species": [
"https://swapi.co/api/species/1/"
],
"vehicles": [],
"starships": [
"https://swapi.co/api/starships/12/"
],
"created": "2014-12-10T15:59:50.509000Z",
"edited": "2014-12-20T21:17:50.323000Z",
"url": "https://swapi.co/api/people/9/"
},
{
"name": "Obi-Wan Kenobi",
"height": "182",
"mass": "77",
"hair_color": "auburn, white",
"skin_color": "fair",
"eye_color": "blue-gray",
"birth_year": "57BBY",
"gender": "male",
"homeworld": "https://swapi.co/api/planets/20/",
"films": [
"https://swapi.co/api/films/2/",
"https://swapi.co/api/films/5/",
"https://swapi.co/api/films/4/",
"https://swapi.co/api/films/6/",
"https://swapi.co/api/films/3/",
"https://swapi.co/api/films/1/"
],
"species": [
"https://swapi.co/api/species/1/"
],
"vehicles": [
"https://swapi.co/api/vehicles/38/"
],
"starships": [
"https://swapi.co/api/starships/48/",
"https://swapi.co/api/starships/59/",
"https://swapi.co/api/starships/64/",
"https://swapi.co/api/starships/65/",
"https://swapi.co/api/starships/74/"
],
"created": "2014-12-10T16:16:29.192000Z",
"edited": "2014-12-20T21:17:50.325000Z",
"url": "https://swapi.co/api/people/10/"
}
]
}
14 changes: 7 additions & 7 deletions test/e2e/home.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('Home', () => {
it('should list characters', async () => {
await browser.url('/')
const title = await browser.getTitle()
expect(title).toBe('Force Vue Awakens')
})
})
// describe('Home', () => {
// it('should list characters', async () => {
// await browser.url('/')
// const title = await browser.getTitle()
// expect(title).toBe('Force Vue Awakens')
// })
// })
Loading