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
| store.dispatch('increment') |
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
| export default { | |
| async asyncData ({ params }) { | |
| let { data } = await axios.get(`https://my-api/posts/${params.id}`) | |
| return { title: data.title } | |
| } | |
| } |
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 { by, browser, element } from 'protractor'; | |
| import { HomePage } from './pages/home.page'; | |
| describe('Conduit App E2E Test Suite', () => { | |
| const homePage = new HomePage(); | |
| describe('home page should work fine', () => { | |
| beforeAll(() => { | |
| homePage.getPage(); | |
| }); |
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 { by, browser, element } from 'protractor'; | |
| import { HomePage } from './pages/home.page'; | |
| describe('Conduit App E2E Test Suite', () => { | |
| const homePage = new HomePage(); | |
| describe('home page should work fine', () => { | |
| beforeAll(() => { | |
| homePage.getPage(); | |
| }); |
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 { element, browser, by, Key } from 'protractor'; | |
| export class HomePage { | |
| getPage() { | |
| return browser.get('/'); | |
| } | |
| getPageTitle() { | |
| return browser.getTitle(); | |
| } |
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('should have right title', () => { | |
| homePage.getPageTitle() | |
| .then((title: string) => { | |
| expect(title).toEqual('Conduit'); | |
| }); | |
| }) |
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
| globalFeedTab() { | |
| return element(by.css('.feed-toggle .nav-pills li.nav-item:nth-of-type(2) a.nav-link')); | |
| } |
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
| getHomePageTag() { | |
| return element(by.tagName('home-page')); | |
| } |
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
| const li = element(by.xpath('//ul/li/a')); | |
| expect(li.getText()).toBe('Hola Mundo'); |
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('should load the global feed articles', () => { | |
| browser.wait(homePage.getGlobalArticlesLoader().getAttribute('hidden'), 8000); | |
| expect(homePage.getGlobalArticlesPreviews().count()).toBeGreaterThan(0); | |
| }); |