1 year ago

#76439

test-img

Justin Grabenbauer

Testcafe runs on average 2-3 times slower when using SSL

After installing and using a self-signed SSL certificate by following the official guide here and running our test suites it was discovered that the tests take about 3 times as long. I would expect there to maybe be some sort of delay but that's a lot.

Any ideas on why this is the case?

With SSL: 45 passed (6m 56s)

Without SSL: 45 passed (2m 55s)

.testcaferc.js File

let filtered_tests = [
    // Located in editor_page_tests.js
    'user_is_able_to_add_a_section_column_row_and_element_to_editor', 
    'pop_up_element_displays_during_page_preview',
    'clicking_button_shows_hides_elements',
    'user_is_able_to_save_when_adding_a_video',
    'user_is_able_to_save_when_leaving_video_embed_blank',

    // Located in courses_page_tests.js
    'user_can_preview_existing_course',
    'optin_user_can_navigate_through_course',
    'manually_added_user_can_navigate_through_course',
    
    // Located in funnels_page_tests.js
    'user_can_navigate_through_funnel',

    // Located in developer_portal_page_tests.js
    'user_can_navigate_to_developer_portal_page',

    // Located in members_page_tests.js
    'user_can_navigate_to_team_members_page',

    // Located in teams_dashboard_pages_tests.js
    'user_can_navigate_to_team_dashboard_page',

    // Located in workspaces_page_tests.js
    'user_can_navigate_to_team_workspaces_page'
]

let isolated_tests = [
    // Located in sites_overview_page_tests.js
    'user_can_make_site_public',
    'user_can_edit_site_name',
    'user_can_make_site_password_protected',
    'user_can_make_site_private',
    'user_can_edit_site_domain',
    'changing_site_domain_updates_funnel_urls',

    // Located in account_details_page_tests.js
    'user_can_edit_account_name',

    // Located in account_details_page_tests.js
    'user_can_edit_account_password',

    // Located in general_page_tests.js
    'user_can_edit_workspace_details'
]

let full_filter = filtered_tests.concat(isolated_tests)

let build_filter = () => {

    // Purpose: To set the suite that we want to run. (Sanity, Smoke, Regression)

    var filter = {}
        if(process.env.SCOPE) {
            filter = {
                testGrep: `^(?!.*(${filtered_tests.join('|')})).*$`,
                testMeta: {
                    scope: process.env.SCOPE
                }
            }
        } else {
            filter = {
                testGrep: `^(?!.*(${full_filter.join('|')})).*$`
            }
        }

    return filter
}

let determine_concurrency = () => {

    // Purpose: To set concurrency dependant on the scope that is passed
    
    let concurrency = 5
    if (process.env.SCOPE == 'isolated') {
        concurrency = 1
    } 
    return concurrency
}

module.exports = {
    assertionTimeout: 5000,
    browsers: [
        "chrome:headless --window-size=1920,1159 --allow-insecure-localhost"
    ],
    concurrency: determine_concurrency(),
    cache: true,
    clientScripts: "scripts/hide_notifications.js",
    filter: build_filter(),
    hostname: "localhost",
    pageLoadTimeout: 30000,
    quarantineMode: {
        successThreshold: 1,
        attemptLimit: 3
    },
    reporter: [
        {
            name: "spec",
            output: "artifacts/reports/spec_results"
        },
        {
            name: "xunit",
            output: "artifacts/reports/xunit_results.xml"
        }
    ],
    screenshots: {
        path: "artifacts/screenshots",
        pathPattern: "${TEST}_${DATE}_${TIME}.png",
        takeOnFails: true,
        thumbnails: false
    },
    selectorTimeout: 5000,
    skipJsErrors: true,
    skipUncaughtErrors: true,
    src: "tests/**",
    ssl: {
        pfx: "ssl/testingdomain.pfx",
        rejectUnauthorized: true
    },
    videoEncodingOptions: {
        aspect: "16:9",
        framerate: 30
    },
    videoOptions: {
        failedOnly: true,
        pathPattern: "${TEST}_${DATE}_${TIME}.mp4",
        singleFile: false
    },
    videoPath: "artifacts/recordings"
}

ssl

testing

openssl

automated-tests

testcafe

0 Answers

Your Answer

Accepted video resources