test: arreglar pruebas

- eliminar las pruebas que son específicas de ga
- arreglar pruebas e2e
- arreglar `deploy-to-firebase.test.sh`
- actualizar ``@angular/fire`
This commit is contained in:
Michael Prentice 2020-09-29 03:17:05 -04:00
parent eff4e3e3c2
commit 4d33c41e92
6 changed files with 14 additions and 275 deletions

View File

@ -322,7 +322,7 @@ jobs:
executor:
name: default-executor
resource_class: medium
parallelism: 5
parallelism: 4
steps:
- custom_attach_workspace
- init_environment
@ -330,9 +330,9 @@ jobs:
# Install aio
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
# Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
# Since the parallelism is set to "5", there will be five parallel CircleCI containers.
# Since the parallelism is set to "4", there will be four parallel CircleCI containers.
# with either "0", "1", etc as node index. This can be passed to the "--shard" argument.
- run: yarn --cwd aio example-e2e --setup --local <<# parameters.viewengine >>--viewengine<</ parameters.viewengine >> --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL} --retry 2
- run: yarn --cwd aio example-e2e --setup --local <<# parameters.viewengine >>--viewengine<</ parameters.viewengine >> --cliSpecsConcurrency=4 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL} --retry 2
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
aio_preview:

View File

@ -93,7 +93,7 @@
"@angular/compiler": "10.0.2",
"@angular/core": "10.0.2",
"@angular/elements": "10.0.2",
"@angular/fire": "6.0.0",
"@angular/fire": "~6.0.3",
"@angular/forms": "10.0.2",
"@angular/material": "10.0.1",
"@angular/platform-browser": "10.0.2",

View File

@ -146,32 +146,6 @@ Deployment URL : https://v2.angular.io/"
check "$actual" "$expected"
)
(
echo ===== archive - v9-angular-io multisite special case - deploy success
actual=$(
export BASH_ENV=/dev/null
export CI_REPO_OWNER=angular
export CI_REPO_NAME=angular
export CI_PULL_REQUEST=false
export CI_BRANCH=9.1.x
export CI_STABLE_BRANCH=10.0.x
export CI_COMMIT=$(git ls-remote origin 9.1.x | cut -c1-40)
export CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN=XXXXX
$deployToFirebaseDryRun
)
expected="Git branch : 9.1.x
Build/deploy mode : archive
Firebase project : aio-staging
Firebase site : v9-angular-io
Deployment URL : https://v9.angular.io/"
# TODO: This test incorrectly expects the Firebase project to be v9-angular-io.
# v9-angular-io is a "multisites" project currently within the aio-staging project
# This setup is temporary and was created in order to deploy v9.angular.io without
# disruptions.
# See https://angular-team.atlassian.net/browse/DEV-125 for more info.
check "$actual" "$expected"
)
(
echo ===== archive - skip deploy - commit not HEAD
actual=$(

View File

@ -75,7 +75,7 @@ describe('site App', function() {
it('should show the tutorial index page at `/tutorial` after jitterbugging through features', () => {
// check that we can navigate directly to the tutorial page
page.navigateTo('tutorial');
expect(page.getDocViewerText()).toMatch(/Tour of Heroes App and Tutorial/i);
expect(page.getDocViewerText()).toMatch(/Aplicación y tutorial Tour de héroes/i);
// navigate to a different page
page.click(page.getTopMenuLink('features'));
@ -86,8 +86,8 @@ describe('site App', function() {
// Tutorial folder should still be expanded because this test runs in wide mode
// Navigate to the tutorial introduction via a link in the sidenav
page.click(page.getNavItem(/The Hero Editor/i));
expect(page.getDocViewerText()).toMatch(/The Hero Editor/i);
page.click(page.getNavItem(/El Editor de Héroe/i));
expect(page.getDocViewerText()).toMatch(/The hero editor/i);
});
it('should render `{@example}` dgeni tags as `<code-example>` elements with HTML escaped content', () => {
@ -114,7 +114,7 @@ describe('site App', function() {
page.scrollTo('bottom');
expect(page.getScrollTop()).toBeGreaterThan(0);
page.click(page.getNavItem(/security/i));
page.click(page.getNavItem(/Seguridad/i));
expect(page.locationPath()).toBe('/guide/security');
expect(page.getScrollTop()).toBe(0);
});
@ -173,38 +173,6 @@ describe('site App', function() {
});
});
describe('google analytics', () => {
it('should call ga with initial URL', done => {
let path: string;
page.navigateTo('api');
page.locationPath()
.then(p => path = p)
.then(() => page.ga())
.then(calls => {
// The last call (length-1) will be the `send` command
// The second to last call (length-2) will be the command to `set` the page url
expect(calls[calls.length - 2]).toEqual(['set', 'page', path]);
done();
});
});
it('should call ga with new URL on navigation', done => {
let path: string;
page.navigateTo('');
page.click(page.getTopMenuLink('features'));
page.locationPath()
.then(p => path = p)
.then(() => page.ga())
.then(calls => {
// The last call (length-1) will be the `send` command
// The second to last call (length-2) will be the command to `set` the page url
expect(calls[calls.length - 2]).toEqual(['set', 'page', path]);
done();
});
});
});
describe('404 page', () => {
it('should add or remove the "noindex" meta tag depending upon the validity of the page', () => {
page.navigateTo('');

View File

@ -1,205 +0,0 @@
import { browser } from 'protractor';
import { SitePage } from './app.po';
/* tslint:disable:max-line-length */
describe('onerror handler', function() {
let page: SitePage;
beforeAll(() => {
page = new SitePage();
page.navigateTo('');
});
it('(called without an error object) should call ga with a payload based on the message, url, row and column arguments', async () => {
const message1 = await callOnError('Error: some error message', 'some-file.js', 12, 3, undefined);
expect(message1).toEqual('some error message\nsome-file.js:12:3');
const message2 = await callOnError('Error: some error message', undefined, undefined, undefined, undefined);
expect(message2).toEqual('some error message\nnull:?:?');
});
it('(called without an error object) should call ga with a payload that is no longer that 150 characters', async () => {
const message = await callOnError(
'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' +
'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz',
'some-file.js', 12, 3, undefined);
expect(message).toEqual(
'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' +
'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst');
});
it('(called with a Firefox on android style error) should call ga with a payload based on the error object', async () => {
const message = await callOnError('Error: something terrible has happened. oh no. oh no.', undefined, undefined, undefined, {
stack: `AppComponent@https://example.com/app/app.component.ts:31:29
createClass@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:12200:20
createDirectiveInstance@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:12049:37
createViewNodes@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:13487:53
createRootView@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:13377:5
callWithDebugContext@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:14778:39
debugCreateRootView@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:14079:12
ComponentFactory_.prototype.create@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:10998:37
ComponentFactoryBoundToModule.prototype.create@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:3958:16
ApplicationRef.prototype.bootstrap@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5769:40
PlatformRef.prototype._moduleDoBootstrap/<@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5496:74
PlatformRef.prototype._moduleDoBootstrap@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5496:13
PlatformRef.prototype.bootstrapModuleFactory/</</<@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5417:21
ZoneDelegate.prototype.invoke@https://example.com/packages/zone.js@0.8.18/dist/zone.js:392:17
forkInnerZoneWithAngularBehavior/zone._inner<.onInvoke@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:4665:24
ZoneDelegate.prototype.invoke@https://example.com/packages/zone.js@0.8.18/dist/zone.js:391:17
Zone.prototype.run@https://example.com/packages/zone.js@0.8.18/dist/zone.js:142:24
scheduleResolveOrReject/<@https://example.com/packages/zone.js@0.8.18/dist/zone.js:873:52
ZoneDelegate.prototype.invokeTask@https://example.com/packages/zone.js@0.8.18/dist/zone.js:425:17
forkInnerZoneWithAngularBehavior/zone._inner<.onInvokeTask@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:4656:24
ZoneDelegate.prototype.invokeTask@https://example.com/packages/zone.js@0.8.18/dist/zone.js:424:17
Zone.prototype.runTask@https://example.com/packages/zone.js@0.8.18/dist/zone.js:192:28
drainMicroTaskQueue@https://example.com/packages/zone.js@0.8.18/dist/zone.js:602:25` } as Error);
expect(message).toEqual(`something terrible has happened. oh no. oh no.
AppComponent@app.component.ts:31:29
createClass@core.umd.js:12200:20
createDirectiveInstance@core.umd.j`);
});
it('(called with a Safari 11 style error) should call ga with a payload based on the error object', async () => {
const message = await callOnError('Error: something terrible has happened. oh no. oh no.', undefined, undefined, undefined, {
stack: `AppComponent
createClass
createDirectiveInstance
createViewNodes
createRootView
callWithDebugContext
create
bootstrap
forEach@[native code]
_moduleDoBootstrap
onInvoke
run
onInvokeTask
runTask
drainMicroTaskQueue
promiseReactionJob@[native code]` } as Error);
expect(message).toEqual(`something terrible has happened. oh no. oh no.
AppComponent
createClass
createDirectiveInstance
createViewNodes
createRootView
callWithDebugContext
cr`);
});
it('(called with a Opera 50 style error) should call ga with a payload based on the error object', async () => {
const message = await callOnError('Error: something terrible has happened. oh no. oh no.', undefined, undefined, undefined, {
stack: `Error: something terrible has happened. oh no. oh no.
at new AppComponent (https://example.com/app/app.component.ts:31:29)
at createClass (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:12200:20)
at createDirectiveInstance (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:12049:37)
at createViewNodes (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:13487:53)
at createRootView (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:13377:5)
at callWithDebugContext (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:14778:42)
at Object.debugCreateRootView [as createRootView] (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:14079:12)
at ComponentFactory_.create (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:10998:46)
at ComponentFactoryBoundToModule.create (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:3958:29)
at ApplicationRef.bootstrap (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5769:57)` } as Error);
expect(message).toEqual(`something terrible has happened. oh no. oh no.
new AppComponent@app.component.ts:31:29
createClass@core.umd.js:12200:20
createDirectiveInstance@core.u`);
});
it('(called with a Chrome 64 style error) should call ga with a payload based on the error object', async () => {
const message = await callOnError('Error: something terrible has happened. oh no. oh no.', undefined, undefined, undefined, {
stack: `Error: something terrible has happened. oh no. oh no.
at new AppComponent (https://example.com/app/app.component.ts:31:29)
at createClass (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:12200:20)
at createDirectiveInstance (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:12049:37)
at createViewNodes (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:13487:53)
at createRootView (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:13377:5)
at callWithDebugContext (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:14778:42)
at Object.debugCreateRootView [as createRootView] (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:14079:12)
at ComponentFactory_.create (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:10998:46)
at ComponentFactoryBoundToModule.create (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:3958:29)
at ApplicationRef.bootstrap (https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5769:57)` } as Error);
expect(message).toEqual(`something terrible has happened. oh no. oh no.
new AppComponent@app.component.ts:31:29
createClass@core.umd.js:12200:20
createDirectiveInstance@core.u`);
});
it('(called with a Firefox 58 style error) should call ga with a payload based on the error object', async () => {
const message = await callOnError('Error: something terrible has happened. oh no. oh no.', undefined, undefined, undefined, {
stack: `AppComponent@https://example.com/app/app.component.ts:31:29
createClass@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:12200:20
createDirectiveInstance@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:12049:37
createViewNodes@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:13487:53
createRootView@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:13377:5
callWithDebugContext@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:14778:39
debugCreateRootView@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:14079:12
ComponentFactory_.prototype.create@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:10998:37
ComponentFactoryBoundToModule.prototype.create@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:3958:16
ApplicationRef.prototype.bootstrap@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5769:40
PlatformRef.prototype._moduleDoBootstrap/<@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5496:74
PlatformRef.prototype._moduleDoBootstrap@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5496:13
PlatformRef.prototype.bootstrapModuleFactory/</</<@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:5417:21
ZoneDelegate.prototype.invoke@https://example.com/packages/zone.js@0.8.18/dist/zone.js:392:17
onInvoke@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:4665:24
ZoneDelegate.prototype.invoke@https://example.com/packages/zone.js@0.8.18/dist/zone.js:391:17
Zone.prototype.run@https://example.com/packages/zone.js@0.8.18/dist/zone.js:142:24
scheduleResolveOrReject/<@https://example.com/packages/zone.js@0.8.18/dist/zone.js:873:52
ZoneDelegate.prototype.invokeTask@https://example.com/packages/zone.js@0.8.18/dist/zone.js:425:17
onInvokeTask@https://example.com/packages/@angular/core@5.0.0/bundles/core.umd.js:4656:24
ZoneDelegate.prototype.invokeTask@https://example.com/packages/zone.js@0.8.18/dist/zone.js:424:17
Zone.prototype.runTask@https://example.com/packages/zone.js@0.8.18/dist/zone.js:192:28
drainMicroTaskQueue@https://example.com/packages/zone.js@0.8.18/dist/zone.js:602:25` } as Error);
expect(message).toEqual(`something terrible has happened. oh no. oh no.
AppComponent@app.component.ts:31:29
createClass@core.umd.js:12200:20
createDirectiveInstance@core.umd.j`);
});
it('(called with a Edge 16 style error) should call ga with a payload based on the error object', async () => {
const message = await callOnError('Error: something terrible has happened. oh no. oh no.', undefined, undefined, undefined, {
stack: `Error: something terrible has happened. oh no. oh no.
at AppComponent (eval code:31:21)
at createClass (eval code:12200:13)
at createDirectiveInstance (eval code:12049:5)
at createViewNodes (eval code:13487:21)
at createRootView (eval code:13377:5)
at callWithDebugContext (eval code:14778:9)
at debugCreateRootView (eval code:14079:5)
at ComponentFactory_.prototype.create (eval code:10998:9)
at ComponentFactoryBoundToModule.prototype.create (eval code:3958:9)
at ApplicationRef.prototype.bootstrap (eval code:5769:9)` } as Error);
expect(message).toEqual(`something terrible has happened. oh no. oh no.
AppComponent@???:31:21
createClass@???:12200:13
createDirectiveInstance@???:12049:5
createViewNodes@???`);
});
async function callOnError(message: string, url?: string, line?: number, column?: number, error?: Error) {
await browser.executeScript(function() {
// reset the ga queue
(window as any).ga.q.length = 0;
// post the error to the handler
if (window.onerror) {
window.onerror(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
}
}, message, url, line, column, error);
const gaCalls = await page.ga();
const exceptionCall = gaCalls.find(call => call[0] === 'send' && call[1] === 'exception');
if (exceptionCall) {
const payload = exceptionCall[2];
expect(payload.exFatal).toBe(true);
return payload.exDescription;
}
}
});

View File

@ -223,10 +223,12 @@
dependencies:
tslib "^2.0.0"
"@angular/fire@6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@angular/fire/-/fire-6.0.0.tgz#c1dbae9e78ed74af951fb7222108c444300a4d15"
integrity sha512-zWhaJaZPtfJKiNSb1I3WqqvopW0fN3S61w4PjPdsm5WME+9M9alP0zpRVclpbCU26LpBSLhrRrSLyn3ROlAOIw==
"@angular/fire@~6.0.3":
version "6.0.3"
resolved "https://registry.yarnpkg.com/@angular/fire/-/fire-6.0.3.tgz#7e4e988409cfc22e3abd4085c7c4b7d6f8f2533a"
integrity sha512-teaPvVPEZA2ymHkaCyJC5KJbp+Ai5nLHsEVUXSJZRCUV8KTg/XOG/toNiATHtwxGgxrKRZ63pOfQFonZYT8TLw==
dependencies:
tslib "^2.0.0"
"@angular/forms@10.0.2":
version "10.0.2"