Skip to content

Instantly share code, notes, and snippets.

View paramsinghvc's full-sized avatar
💭
I may be slow to respond.

Param Singh paramsinghvc

💭
I may be slow to respond.
View GitHub Profile
store.dispatch('increment')
export default {
async asyncData ({ params }) {
let { data } = await axios.get(`https://my-api/posts/${params.id}`)
return { title: data.title }
}
}
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();
});
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();
});
import { element, browser, by, Key } from 'protractor';
export class HomePage {
getPage() {
return browser.get('/');
}
getPageTitle() {
return browser.getTitle();
}
it('should have right title', () => {
homePage.getPageTitle()
.then((title: string) => {
expect(title).toEqual('Conduit');
});
})
globalFeedTab() {
return element(by.css('.feed-toggle .nav-pills li.nav-item:nth-of-type(2) a.nav-link'));
}
getHomePageTag() {
return element(by.tagName('home-page'));
}
const li = element(by.xpath('//ul/li/a'));
expect(li.getText()).toBe('Hola Mundo');
@paramsinghvc
paramsinghvc / wait.ts
Last active September 13, 2017 17:29
it('should load the global feed articles', () => {
browser.wait(homePage.getGlobalArticlesLoader().getAttribute('hidden'), 8000);
expect(homePage.getGlobalArticlesPreviews().count()).toBeGreaterThan(0);
});