[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:
Andy
2020-05-14 13:30:11 +02:00
committed by GitHub
parent 3c75f1440d
commit ef63247fc0
232 changed files with 16033 additions and 2 deletions

View 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;

View 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 } }));
}
};

View 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();
});
});

View 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));
}
}

View File

@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": ["jasmine", "jasminewd2", "node"]
}
}