mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 12:57:46 +00:00
[examples][frameworks] Add missing examples and add a test to ensure every framework has an example (#4372)
* Add test to frameworks * Add example for Docusaurus v2 * Add example for ionic-angular * Update READMEs * Use existing versions * Reset yarn.lock * Add schema validation and add missing Scully.io logo
This commit is contained in:
11
examples/ionic-angular/e2e/protractor-ci.conf.js
Normal file
11
examples/ionic-angular/e2e/protractor-ci.conf.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const config = require('./protractor.conf').config;
|
||||
|
||||
config.capabilities = {
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
args: ['--headless', '--no-sandbox', '--disable-gpu'],
|
||||
binary: require('puppeteer').executablePath(),
|
||||
},
|
||||
};
|
||||
|
||||
exports.config = config;
|
||||
28
examples/ionic-angular/e2e/protractor.conf.js
Normal file
28
examples/ionic-angular/e2e/protractor.conf.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||
|
||||
exports.config = {
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./src/**/*.e2e-spec.ts'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome'
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
framework: 'jasmine',
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function() {}
|
||||
},
|
||||
onPrepare() {
|
||||
require('ts-node').register({
|
||||
project: require('path').join(__dirname, './tsconfig.json')
|
||||
});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
||||
}
|
||||
};
|
||||
24
examples/ionic-angular/e2e/src/app.e2e-spec.ts
Normal file
24
examples/ionic-angular/e2e/src/app.e2e-spec.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { AppPage } from './app.po';
|
||||
|
||||
describe('new App', () => {
|
||||
let page: AppPage;
|
||||
|
||||
beforeEach(() => {
|
||||
page = new AppPage();
|
||||
});
|
||||
|
||||
it('should display the menu', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getMenu()).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should get the slides text', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getFirstSlide()).toBe('ion-slide');
|
||||
});
|
||||
|
||||
it('should create a router outlet', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getRouter()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
33
examples/ionic-angular/e2e/src/app.po.ts
Normal file
33
examples/ionic-angular/e2e/src/app.po.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { browser, by, element, ElementFinder, ExpectedConditions } from 'protractor';
|
||||
|
||||
export class AppPage {
|
||||
navigateTo() {
|
||||
return browser.get('/');
|
||||
}
|
||||
|
||||
async getMenu() {
|
||||
const el = this.getElement('app-root ion-menu');
|
||||
await this.waitForSelector(el);
|
||||
return el;
|
||||
}
|
||||
|
||||
async getFirstSlide() {
|
||||
const el = this.getElement('app-root ion-slides ion-slide:first-child');
|
||||
await this.waitForSelector(el);
|
||||
return el.getTagName();
|
||||
}
|
||||
|
||||
async getRouter() {
|
||||
const el = this.getElement('app-root ion-router-outlet');
|
||||
await this.waitForSelector(el);
|
||||
return el;
|
||||
}
|
||||
|
||||
async waitForSelector(el: ElementFinder) {
|
||||
return browser.wait(ExpectedConditions.presenceOf(el), 3000);
|
||||
}
|
||||
|
||||
getElement(selector) {
|
||||
return element(by.css(selector));
|
||||
}
|
||||
}
|
||||
9
examples/ionic-angular/e2e/tsconfig.json
Normal file
9
examples/ionic-angular/e2e/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/app",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": ["jasmine", "jasminewd2", "node"]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user