Expert


Specific tools for testing web applications(selenium/webunit/ siege/phantomjs)

selenium-webdriver:

const { Builder } = require('selenium-webdriver');
const firefox = require('selenium-webdriver/firefox');

const proxyServer = '206.189.154.182:8000';
const options = new firefox.Options();

options.setPreference("browser.download.dir", "C:\\mySeleniumDownloads");
options.setPreference("browser.download.folderList", 2);
options.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/x-csv");

const driver = new Builder()
    .forBrowser('firefox')
    .setFirefoxOptions(options)
    .setProxy(proxy.manual({
        http: proxyServer,
        https: proxyServer,
    }))
    .build();

driver.get('http://facebook.com');

Cypress (cypress/intergration)

describe('Form input', () => {
    beforeEach(() => {
        cy.visit('/')
    })

    it('Focuses the input on load', () => {
        cy.focused()
          .should('have.class', 'new-todo')
    });

    it('Accepts input', () => {
        const typedText = 'New todo';

        cy.get('new-todo')
          .type(typedtext)
          .should('have.value', typedText)
    })
})

Integration with Build Automation and Continuous Integration systems

Automation testing is important for a successful Continuous Integration/Continuous Delivery (CI/CD) pipeline because:

Easy and efficient assessment of minor changes – considering that in a continuous integration process most of the changes are small and test automation is able to cover them, the team can continuously deliver changes which have already been tested enough. Besides automated tests, some infrequent manual testing activities remain crucial after a major update of software, like usability testing. Faster regression tests – the continuous delivery process requires quick feedback. Automation testing can be executed much more quickly than manual testing and provide results quickly. To help shorten the overall execution time, automated tests can run in parallel. More consistent results – an efficient continuous integration pipeline should not contain too many variations or anomalies. To meet expectations all the way to the release, process consistency should be maintained. Better agility – new technologies appear and requirements change. That’s why a good pipeline should be flexible to update frameworks, adjust configurations and introduce new tools. Having too much manual testing makes a CI/CD pipeline less agile. Pipelines utilizing test automation can be reconfigured automatically.

Deployment pipeline

Deployment-pipeline

A key pattern of CD is a deployment pipeline which includes continuous integration and test automation. As shown in the diagrams, code changes should pass a set of tests:

  • Unit tests
  • Automated regression tests (functional tests)
  • Exploratory and usability tests (functional tests)

Continuous_Delivery_process_diagram

In the continuous deployment pipeline, every code change could be a release candidate. One of the tasks of a deployment pipeline is to catch regression issues. If no regression problems can be detected, packages could be released successfully. If any defects are discovered later, the pipeline should be improved by adding or updating tests.

Problems should be found as soon as possible and the time from check-in to release should be shorter. Parallelization of activities in the deployment pipeline instead of many consecutive stages execution could help. The feedback process is important as well:

  • If bugs are discovered in exploratory testing, automated tests should be improved.
  • If defects are discovered in the acceptance tests, unit tests should be improved (unit testing should find most of the defects).

A reliable approach to automation testing

stages-of-development-and-testing

The ability to identify tests for automation is key to creating the best technical approach. Frequently repeated tasks are consuming the most resources and are, therefore, the best candidates for the automation process. Once automation testing is completed then manual testing is still required. In the context of automation, there are various types of tests.

TestPyramid

UNIT TESTING

This type of test checks that individual units of the code are functioning and could be integrated into the repository. Usually, these tests are focused on locations where bugs might be hiding and on individual functions. Unit tests should be very fast and cover around 80% of the codebase. This can give enough confidence that the application is functioning properly at this point. If unit tests are not automated, there will not be much chance to achieve success.

COMPONENT INTEGRATION TESTING

Integration tests are executed to find defects in the interactions between integrated components or systems.

USER INTERFACE (UI) TESTING

UI testing checks that the frontend interfaces of an application are shown and working as it was described in requirements, in all supported browsers and platforms. Virtual machines can be and are often used to test multiple combinations at high speed in parallel.

API (MIDDLEWARE) TESTING

API tests are checking the interoperability between software systems and components. These tests simulate calls to API endpoints and validate the responses from the server.

FUNCTIONAL SOFTWARE TESTING

During functional testing, different functions of the app are compared against the requirements or specifications. A tester represents the user or customer, who is using the application. Functional testing focuses on the user functionality rather than internal interaction of the application’s components.

REGRESSION TESTING

The goal of regression testing is to discover bugs that might occur because of enhancements and bug fixes. In order to validate that existing functionality is still working, existing test cases should be executed against new code changes prior to the release. To save time during frequent releases, teams sometimes spend less time on regression testing. Doing this could mean that bugs could reach the end-users. This is a type of testing that is a good candidate for automation.