Commit graph

11 commits

Author SHA1 Message Date
WMDE-Fisch b3a58a6dd3 Move browser tests loading steps to beforeEach
- test page loading and waiting for the scripts moved to beforeEach
- removed unnecessary abondonLink call
- removed unnecessary browser.pause()

Change-Id: I28eb7b9b48f105315bf41f7a41e5a1e6ec21cb2b
2019-04-05 15:56:16 +00:00
WMDE-Fisch 07318c3a33 Add test for dwelling reference links inside a reference preview
Bug: T214971
Change-Id: Ib2f782a67d85647a385f81d5d5fca89b221a9e22
2019-03-25 12:37:05 +00:00
WMDE-Fisch dc1625de64 Add tests for the reference preview fade effect
Bug: T214971
Change-Id: Ie59347e7f51d449900d3a107fd85b0753a14f449
2019-03-25 12:36:47 +00:00
Thiemo Kreuz fb5b120515 Minor fix-ups to type hints in JavaScript code
This patch also removes misplaced empty lines at the beginning of a
scope. In PHP code we even have a sniff for these. In JavaScript we
don't, but I suggest to be consistent about this.

Change-Id: Ic104ae8fe176da1dafa9bc783402adecb71de1f0
2019-02-14 11:15:01 +01:00
WMDE-Fisch 0c3d876b45 Avoid arrow functions in browser tests
Mocha discourages the usage of arrow functiones in the test specs since
Mocha context can't be accessed from inside.

I stumbled across this when using this.skip(); in the reference preview
selenium tests. Since it took me some time to figure out why it was not
working, I guess it's better to avoid lambdas generally there.

See https://mochajs.org/#arrow-functions

Change-Id: I95cb183ac88e9a624c449a8f9addbe84bf76c335
2019-01-29 16:37:37 +00:00
WMDE-Fisch 645aa24b7c Add browser tests for reference previews
The test setup was slightly refactored to be more general about
the type of the popup.

The additional reference links on the test page were added mostly
to be prepared for further tests of more complex cases.

On the CI the tests should be executed with having reference
popups enabled. The code tries to skip test when the feature is
disabled.

See I17687c62cc8d738a4eb41738c9ce6662a5ec68d8
and I1eb7409aa3bd111c2e461dfe245d95f7e78d416c

Bug: T213415
Change-Id: I74110c6227596ff10c75f5f0b0da3d952f11a239
2019-01-24 12:42:49 +00:00
Stephen Niedzielski ae44042cbf Hygiene: add assertion messages
Change-Id: Ic0a47bd468532824e8648c3f6371cc403896603c
2018-05-08 15:55:23 -05:00
Stephen Niedzielski 57762e0417 Hygiene: favor const
Bug: T165036
Change-Id: I17d374eaac6627ca6a8ba178862b2a9cff2538c0
2018-03-21 10:44:24 +00:00
Stephen Niedzielski 0bee0906d4 Hygiene: replace var with let and const
eslint \
    --cache \
    --max-warnings 0 \
    --report-unused-disable-directives \
    --fix \
    src tests

Change-Id: I051275126ae7fa9affd16c2504017c0584f2d9c7
2018-03-20 14:14:02 -05:00
Stephen Niedzielski ece4670710 Hygiene: use arrow for anonymous functions
In some places, the arrow function seems more natural. This patch
approximates the following with manual amendments:

  find \
    -not \( \( -name node_modules -o -name .git -o -name vendor -o -name doc -o -name resources \) -prune \) \
    -iname \*.js|
  xargs -rd\\n sed -ri 's%function\s*(\([^)]*\))%\1 =>%g'

Files to focus on were identified with:

  rg -slg\!/resources/dist/ -g\!/i18n/ -g\!/doc/ 'this|self|arguments|bind|call|apply|new'|
  xargs -rd\\n git difftool -y

Bug: T165036
Change-Id: Ic66b6000b8fc000f9bfde39749f9cfa69924a13c
2018-03-20 09:27:08 -05:00
jdlrobson cf774be88b Port Popups browser tests to selenium
Bug: T177262
Change-Id: Ie77cf7bc79f454904983ed5cf65dc9fe2b1ececc
2017-11-01 13:31:36 -07:00