This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
const todosUrl = 'http://localhost:3001/todos' | |
function Todo ({ number, todo }) { | |
return ( | |
<li>{number}. { todo.title }</li> | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('has home link', async () => { | |
const link = await browser.$('=Home') | |
await expect(link.getAttribute('href')).resolves.toEqual('/') | |
}) | |
it('has todos link', async () => { | |
const link = await browser.$('=Todos') | |
await expect(link.getAttribute('href')).resolves.toEqual('/todos') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('has home page text', async () => { | |
const heading = await browser.$('h1') | |
await expect(heading.getText()).resolves.toEqual('Home') | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.App-nav { | |
display: flex; | |
flex-direction: row; | |
padding: 5px; | |
} | |
.App-nav > a { | |
flex: 1 1 auto; | |
text-align: center; | |
padding:0 15px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import './App.css' | |
import { BrowserRouter as Router, Route, Link } from 'react-router-dom' | |
function Home () { | |
return ( | |
<div> | |
<h1>Home</h1> | |
</div> | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('has introduction text', async () => { | |
// Use the browser selector method to get the heading | |
// See docs for details https://webdriver.io/docs/selectors.html | |
const paragraph = await browser.$('p') | |
await expect(paragraph.getText()).resolves.toEqual('Edit src/App.js and save to reload.') | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import the remote function from webdriver | |
import { remote } from 'webdriverio' | |
// Describe a basic scenario | |
describe('User visits home page', () => { | |
// Define a browser variable to be available to each | |
// assertion that will be declared below | |
let browser | |
// Before all the assertions we set up the browser object | |
// The default configuration for webdriver is async mode, | |
// so we will need to be defined our specs as async functions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entrypoint: bundle exec rackup --port $PORT | |
env: flex | |
runtime: ruby | |
env_variables: | |
SECRET_KEY_BASE: SECRET_BASE | |
beta_settings: | |
cloud_sql_instances: skeleton-application-12345:us-west2:skeleton-application-cloudsql-instance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
production: | |
<<: *default | |
username: deploy | |
password: [PASSWORD] | |
database: skeleton_application_production | |
socket: "/cloudsql/skeleton-application-12345:us-west2:skeleton-application-cloudsql-instance" |
NewerOlder