This file contains 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
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
This file contains 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
function foo() |
This file contains 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
protocol ArrayRepresentable { | |
typealias ArrayType | |
func toArray() -> ArrayType[] | |
} | |
extension Range : ArrayRepresentable { | |
func toArray() -> T[] { | |
return T[](self) | |
} |
This file contains 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
// cypress/integration/login.spec.js | |
describe('login', () => { | |
beforeEach(() => { | |
visitLoginPage() | |
}) | |
it('A User logs in and sees a welcome message', () => { | |
loginWith('[email protected]', 'passsword') | |
expect(cy.contains('Welcome back Michael')).to.exist |
This file contains 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
// cypress/integration/login.spec.js | |
describe('login', () => { | |
beforeEach(() => { | |
visitLoginPage() | |
}) | |
it('A User logs in and sees a welcome message', () => { | |
loginWith('[email protected]', 'passsword') | |
expect(cy.contains('Welcome back Michael')).to.exist |
This file contains 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('A Pro User logs in and sees a thank you message for the first time', () => { | |
loginWith('[email protected]', 'passsword') | |
expect(cy.contains('Thank you for supporting us!')).to.exist | |
}) | |
it('A Pro User logs in and sees and sees a welcome message', () => { | |
loginWith('[email protected]', 'passsword') | |
expect(cy.contains('Welcome back John')).to.exist | |
}) |
This file contains 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
renderWelcome() { | |
// oooppps, did we mean logins? | |
if (props.user.pro && props.user.login.length === 1) { | |
return <p>Thank you for supporting us!</p> | |
} else { | |
return <p>Welcome back {props.user.firstName}</p> | |
} | |
} |
This file contains 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
// not great... | |
describe('Shopping Cart', () => { | |
before(() => { | |
cy.login('[email protected]', 'password') | |
}) | |
it('add item to cart', () => { | |
cy.visit('/products/fidget-spinner-1') | |
cy.contains('Add To Cart').click() | |
cy.contains('Show Cart').click() |
This file contains 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
// This is what you want... | |
describe('Shopping Cart', () => { | |
before(() => { | |
cy.login('[email protected]', 'password') | |
}) | |
beforeEach(() => { | |
resetShoppingCart() | |
}) |
This file contains 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
// cypress/support/commands.js | |
Cypress.Commands.add('login', (email, password) => { | |
cy.request({ | |
method: 'POST', | |
url: 'http://localhost:300/api/v1/users/login', | |
body: { | |
user: { | |
email, | |
password | |
} |
OlderNewer