Environments

Similarly to page objects, environments can be set up to properly organize your desired environments. They may include different URLs and different users for each environment. They will be stored in a special file called oxygen.env.js

setting up our environments:

module.exports = {

    TEST: {
        url: 'https://test.app.com',
        con_string: 'Driver={SQL Server};Server=DESKTOP\\SQLEXPRESS;Database=test;',
        username: 'testuser',
        password: 'test123'
    },

    PREP: {
        url: 'https://prep.app.com',
        con_string: 'Driver={SQL Server};Server=DESKTOP\\SQLEXPRESS;Database=prep;',
        username: 'prepuser',
        password: 'prep123'
    }
    
}

now that we've set them up, we can choose them by clicking on the settings icon on the top right

let's choose the PREP environment and use it in our script:

web.init()
web.open(env.url) // https://prep.app.com

db.setConnectionString(env.con_string) 

web.type('id=username', env.username)
web.type('id=password', env.password)

Last updated