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

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

Merged
merged 1 commit into from
May 6, 2019

Conversation

individual-it
Copy link
Member

backport of #35151

Copy link
Contributor

@dpakach dpakach left a comment

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
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
Copy link

codecov bot commented May 6, 2019

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
Copy link

codecov bot commented May 6, 2019

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
Copy link
Member

skshetry commented May 6, 2019

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