Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(docs-infra): update docs examples to Angular v11.0.1 #39818

Closed

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Nov 23, 2020

This PR updates the docs examples to Angular v11.0.1. In addition to updating the dependencies versions, it also updates the project's structure and config to more closely match what a new v11 CLI app would look like. See, also, the diff between a basic v10.1.3 CLI app and a v11.0.2 one.

It also disables the Selenium Promise Manager (as seen here) and switches all e2e tests to async/await (to align with new CLI v11 apps).

(Supercedes #39787.)

This commit updates the docs examples to Angular v11.0.1. In addition to
updating the dependencies versions, it also updates the project's
structure and config to more closely match what a new v11 CLI app would
look like. See, also, the [diff][1] between a basic v10.1.3 CLI app and a
v11.0.2 one.

NOTE:
I refrained from disabling the Selenium Promise Manager (as seen
[here][2]) and switching all e2e tests to `async/await`, because that is
a big change and should be done in a separate commit/PR.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/10.1.3..11.0.2
[2]:
cexbrayat/angular-cli-diff@10.1.3...11.0.2#diff-dbd675d74087d57cd084d6dd6ae24ae2eeff2ff0122680e12916052f8a843a29
Previously, the test made no meaningful assertion. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.

This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.
Previously, the tests made no meaningful assertions. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.

This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.
This commit removes some code that is no longer necessary for the
`upgrade-module` docs example e2e tests to run. It used to be necessary
in earlier version of Protractor but not any more.
…es e2e tests

This commit disables the Selenium Promise Manager when running e2e tests
for docs examples in order to more closely align them with new apps
created with CLI v11. This change requires that any async operations in
tests are handled explicitly (e.g. using `async/await` or
`Promise#then()`).
@google-cla google-cla bot added the cla: yes label Nov 23, 2020
@gkalpak gkalpak added area: build & ci Related the build and CI infrastructure of the project comp: docs-infra target: patch This PR is targeted for the next patch release and removed cla: yes labels Nov 23, 2020
@ngbot ngbot bot modified the milestone: needsTriage Nov 23, 2020
@google-cla google-cla bot added the cla: yes label Nov 23, 2020
@google-cla

This comment has been minimized.

@gkalpak gkalpak added this to REVIEW in docs-infra Nov 23, 2020
@mary-poppins
Copy link

You can preview 7b3106d at https://pr39818-7b3106d.ngbuilds.io/.

@gkalpak gkalpak marked this pull request as ready for review November 23, 2020 20:15
Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: docs-infra

@@ -144,7 +144,7 @@ describe('demo (with TestBed):', () => {
);
});

describe('using async(inject) within beforeEach', () => {
describe('using waitForAsync(inject) within beforeEach', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that this bit of code does not appear in any guides!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does (e.g. here, here and here), but it was already updated there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not this specific line of code, it doesn't :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah, not this line of code. I meant waitForAsync() in general.
Overall, very few lines from e2e tests are included in the docs as code snippets.

Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: global-docs-approvers

Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public_api

Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: global-approvers

@IgorMinar IgorMinar added the action: merge The PR is ready for merge by the caretaker label Nov 24, 2020
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
This commit updates the docs examples to Angular v11.0.1. In addition to
updating the dependencies versions, it also updates the project's
structure and config to more closely match what a new v11 CLI app would
look like. See, also, the [diff][1] between a basic v10.1.3 CLI app and a
v11.0.2 one.

NOTE:
I refrained from disabling the Selenium Promise Manager (as seen
[here][2]) and switching all e2e tests to `async/await`, because that is
a big change and should be done in a separate commit/PR.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/10.1.3..11.0.2
[2]:
cexbrayat/angular-cli-diff@10.1.3...11.0.2#diff-dbd675d74087d57cd084d6dd6ae24ae2eeff2ff0122680e12916052f8a843a29

PR Close #39818
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
Previously, the test made no meaningful assertion. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.

This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.

PR Close #39818
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
…39818)

Previously, the tests made no meaningful assertions. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.

This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.

PR Close #39818
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
…ts (#39818)

This commit removes some code that is no longer necessary for the
`upgrade-module` docs example e2e tests to run. It used to be necessary
in earlier version of Protractor but not any more.

PR Close #39818
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
…es e2e tests (#39818)

This commit disables the Selenium Promise Manager when running e2e tests
for docs examples in order to more closely align them with new apps
created with CLI v11. This change requires that any async operations in
tests are handled explicitly (e.g. using `async/await` or
`Promise#then()`).

PR Close #39818
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
Previously, the test made no meaningful assertion. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.

This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.

PR Close #39818
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
…39818)

Previously, the tests made no meaningful assertions. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.

This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.

PR Close #39818
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
…ts (#39818)

This commit removes some code that is no longer necessary for the
`upgrade-module` docs example e2e tests to run. It used to be necessary
in earlier version of Protractor but not any more.

PR Close #39818
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
…es e2e tests (#39818)

This commit disables the Selenium Promise Manager when running e2e tests
for docs examples in order to more closely align them with new apps
created with CLI v11. This change requires that any async operations in
tests are handled explicitly (e.g. using `async/await` or
`Promise#then()`).

PR Close #39818
@gkalpak gkalpak deleted the build-aio-upgrade-examples-to-v11 branch November 25, 2020 11:00
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 26, 2020
@pullapprove pullapprove bot removed area: build & ci Related the build and CI infrastructure of the project comp: docs-infra labels Dec 26, 2020
@ngbot ngbot bot removed this from the docs-infra-tooling milestone Dec 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants