Results 1 to 2 of 2

Thread: Testing with Sencha test without using ST

  1. #1

    Default Answered: Testing with Sencha test without using ST

    Hello,

    I try to manage the login in my application with Sencha test. However, the login page does not allow the loading of external script :

    [WARN] [model/browser/SandboxBrowser-55] [WARN] [context/WebDriver] security 371 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' ". Either the 'unsafe-inline' keyword, a hash ('sha256-uVmxiaegTDXu9wVDVfRVBLKAYDJzOZBHunQbwcf4u6w='), or a nonce ('nonce-...') is required to enable inline execution.

    So I think I need to manage this page without the ST API.

    my script should look something like this

    document.getElementById('username').value = 'user';
    document.getElementById('password').value = 'pass';
    document.getElementById('LoginSubmit').click();

    but I don't have acces to the "document", I would like to acces the driver but the only way I know is "ST.defaultContext.driver" that will not work in this page.

    Is there a way to acces to the driver without using ST API or an other way to do this ? has anyone encountered this problematic ?

    Thanks,

    Guillain


  2. If your web app has a Content Security Policy (CSP) in place, then Sencha Test will have issues loading its scripts which are required in order for tests to be executed. This is leading to the error message you referenced.

    This is a known compatibility issue, and we will be looking to address this in a future update of Sencha Test.

    For now, you can workaround the issue by disabling CSP on your staging web server or in your application's code.

  3. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    291
    Answers
    40

    Default

    If your web app has a Content Security Policy (CSP) in place, then Sencha Test will have issues loading its scripts which are required in order for tests to be executed. This is leading to the error message you referenced.

    This is a known compatibility issue, and we will be looking to address this in a future update of Sencha Test.

    For now, you can workaround the issue by disabling CSP on your staging web server or in your application's code.
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

Similar Threads

  1. Replies: 3
    Last Post: 15 Nov 2017, 4:24 PM
  2. Testing outside of Sencha Test
    By niallobrien in forum Q&A
    Replies: 0
    Last Post: 21 Apr 2017, 1:36 AM
  3. Replies: 10
    Last Post: 6 Mar 2017, 7:41 AM
  4. Replies: 1
    Last Post: 20 Apr 2015, 11:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •