Page 2 of 2 FirstFirst 12
Results 11 to 11 of 11

Thread: How maximize browser

  1. #11
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    331
    Answers
    51

    Default

    Glad to hear it's working. For additional reference, this page on our docs describes one way to structure the .js files under the "lib" folder for WebDriver scenarios: https://docs.sencha.com/sencha_test/...g_a_local_file, and then using that lib file in a test suite by leveraging Node's "require" capability.

    One other option to directly reference the contents of one of the lib files is to make a lib function global, for example, you could have a "lib/Login.js" file containing this code, that would handle logging in of the user if not currently logged in:

    Code:
    // lib/Login.js
    global.Login = function() {
        describe('Login', function() {
            it('should login if presented with the login screen', function() {
                ST.getUrl(function(url) {
                    if (url.indexOf('login.html') > 0) {
                        // Log the user in here
                    }
                });
            });
        });
    };
    Then, each of your test suites could use the login functionality above by simply calling "Login()" in each test suite:

    Code:
    // TestSuite.js
    describe('Example test', function() {
        Login();
        
        it('should show a list of data on the home screen', function() {
            // Test goes here
        });
    });
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  2. #12
    Sencha User
    Join Date
    Jan 2017
    Posts
    9

    Default

    Excellent! Thanks for the help. I get the scripts from the folder lib through "require".

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Sencha 2.0.2 - How to Maximize browser window
    By SenderowiczP in forum Q&A
    Replies: 4
    Last Post: 20 Apr 2017, 12:07 AM
  2. Maximize tab to the whole browser
    By dekely in forum Ext: Q&A
    Replies: 7
    Last Post: 26 Jul 2013, 8:11 AM
  3. Maximize Panel To Browser Window
    By jr_core in forum Ext: Discussion
    Replies: 2
    Last Post: 13 Jun 2012, 6:21 AM
  4. is it possible to maximize the browser window without JSNI?
    By pauloallonso in forum Community Discussion
    Replies: 1
    Last Post: 14 Oct 2011, 5:59 PM

Tags for this Thread

Posting Permissions

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