This commit updates `@angular/*` and `@angular/cli` (and related packages) to version 11.0.0-rc.2. Apart from the automatic migrations, this commit also tries to align `aio/` with new apps generated by the latest CLI. (See [here][1] for a diff between a v10.1.3 and a v11.0.0-rc.2 CLI app.) [1]: https://github.com/cexbrayat/angular-cli-diff/compare/10.1.3...11.0.0-rc.2 PR Close #39600
38 lines
995 B
TypeScript
38 lines
995 B
TypeScript
import { element, by } from 'protractor';
|
|
import { SitePage } from './app.po';
|
|
|
|
export class ApiPage extends SitePage {
|
|
getDescendants(docType: string, onlyDirect = false) {
|
|
// This selector is horrible because we have potentially recursive HTML lists
|
|
//
|
|
// ul
|
|
// li
|
|
// code
|
|
// ul
|
|
// li
|
|
// code
|
|
// ul
|
|
// li
|
|
// code
|
|
// li
|
|
// code
|
|
//
|
|
// and we want to be able to pull out the code elements from only the first level
|
|
// if `onlyDirect` is set to `true`.
|
|
const selector = `.descendants.${docType} ${onlyDirect ? '>' : ''} ul > li > code`;
|
|
return element.all(by.css(selector)).map<string>(item => item?.getText());
|
|
}
|
|
|
|
getOverview(docType: string) {
|
|
return element(by.css(`.${docType}-overview`));
|
|
}
|
|
|
|
getSection(cls: string) {
|
|
return element(by.css(`section.${cls}`));
|
|
}
|
|
|
|
getBadge(cls: string) {
|
|
return element(by.css('.api-status-label.' + cls));
|
|
}
|
|
}
|