Skip to content

[stable10] Test Helper to read file from server#35158

Merged
individual-it merged 1 commit into
stable10from
stable10-readFileFromServerHelper
May 6, 2019
Merged

[stable10] Test Helper to read file from server#35158
individual-it merged 1 commit into
stable10from
stable10-readFileFromServerHelper

Conversation

@individual-it

Copy link
Copy Markdown
Member

backport of #35151

@dpakach dpakach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@phil-davis

Copy link
Copy Markdown
Contributor

https://drone.owncloud.com/owncloud/core/17168/903
Firefox WebDriver\Exception\JavaScriptError: ReferenceError: jQuery is not defined
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
so this still happens sometimes.

Restarted drone.

@codecov

codecov Bot commented May 6, 2019

Copy link
Copy Markdown

Codecov Report

Merging #35158 into stable10 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             stable10   #35158   +/-   ##
===========================================
  Coverage       64.47%   64.47%           
  Complexity      20070    20070           
===========================================
  Files            1288     1288           
  Lines           76936    76936           
  Branches         1307     1307           
===========================================
  Hits            49606    49606           
  Misses          26949    26949           
  Partials          381      381
Flag Coverage Δ Complexity Δ
#javascript 53.01% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 65.69% <ø> (ø) 20070 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78b4819...0423f2e. Read the comment docs.

1 similar comment
@codecov

codecov Bot commented May 6, 2019

Copy link
Copy Markdown

Codecov Report

Merging #35158 into stable10 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             stable10   #35158   +/-   ##
===========================================
  Coverage       64.47%   64.47%           
  Complexity      20070    20070           
===========================================
  Files            1288     1288           
  Lines           76936    76936           
  Branches         1307     1307           
===========================================
  Hits            49606    49606           
  Misses          26949    26949           
  Partials          381      381
Flag Coverage Δ Complexity Δ
#javascript 53.01% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 65.69% <ø> (ø) 20070 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78b4819...0423f2e. Read the comment docs.

@skshetry

skshetry commented May 6, 2019

Copy link
Copy Markdown
Contributor

This happens on waitForAjaxCallsToStartAndFinish, so, the page is already loaded but looks like jQuery is still getting parsed/downloaded. So, wherever we execute jQuery scripts from our test code, it'd be better to wait for jQuery to be available(i.e. wait for jQuery to be bound on the window). It could be implemented as following, and add the function wherever we use jquery such as waitForAjaxCallsToStartAndFinish.

function waitTillJqueryIsLoaded(Session $session) {
    // language=JS
    $script = 'function blockTillJqueryIsLoaded() {
                        if (window.jQuery) {
                            return;
                        } else {
                            setTimeout(function() { blockTillJQueryIsLoaded() }, 50);
                        }
               };
               blockTillJqueryIsLoaded();
            ';
    $session->executeScript($script);
}

@individual-it
individual-it merged commit 7a3e0b3 into stable10 May 6, 2019
@delete-merged-branch
delete-merged-branch Bot deleted the stable10-readFileFromServerHelper branch May 6, 2019 16:09
@lock lock Bot locked as resolved and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants