Skip to main content

LUP Student Papers

LUND UNIVERSITY LIBRARIES

Automated Functional Tests for a Web Application

Wulf, Johan LU and Svensson Fahlström, Erik LU (2022) EITL05 20221
Department of Electrical and Information Technology
Abstract
When developing a large application, many companies use techniques such as Test Driven Development in order to get a range of tests on which they later can validate their code with. This has become the standard in many work environments. Problems arise when an application is already developed and tests has not been written in the course of the development. This makes it near impossible to validate the entire code base without spending hundreds of hours writing unit tests which is a problem when engineers costs a lot of money. It is in a companies interest to then find ways to write tests that cover larger parts of an application.

The People Domain team at IKEA has developed an application, where the need for tests was brought to light... (More)
When developing a large application, many companies use techniques such as Test Driven Development in order to get a range of tests on which they later can validate their code with. This has become the standard in many work environments. Problems arise when an application is already developed and tests has not been written in the course of the development. This makes it near impossible to validate the entire code base without spending hundreds of hours writing unit tests which is a problem when engineers costs a lot of money. It is in a companies interest to then find ways to write tests that cover larger parts of an application.

The People Domain team at IKEA has developed an application, where the need for tests was brought to light first when large parts of the application already was developed. This is why this thesis, in coordination with IKEA, investigates and implements an automatic test flow which is run when a developer pushed code to the applications repository. The application is developed by IKEA to make it easier for co-workers to effect their schedule. This is done by creating time slots which are used as requests for when someone want, or does not want, to work.

Since there were no previous tests of the UI made by IKEA, this was a new area to discover. It became apparent that it was harder to automate the entire test flow than first believed. This due to problems with the way that the application authenticates users. The authentication is done through Microsofts portal, which means that it is not the application itself that authenticates. It would require a large re-factorization of the applications structure to make tests work as wanted. To implement the test flow, a number of frameworks and libraries were investigated and evaluated and choices were made for the solutions that seemed to fit IKEAs needs the best. With a combination of meetings, interviews and literature studies information was gathered, both about the application and about the testing of software.

The thesis concludes in a test suite which automatically tests parts of the application. The tests are written with help from the test framework Cypress, and tests the functionality to create a new time slot. (Less)
Popular Abstract (Swedish)
Vid utveckling av stora applikationer använder sig många företag av tekniker så som testdriven utveckling för att skapa en stor samling av test som de sedan kan använda sig av för att validera skriven kod. Detta har blivit standarden på många arbetsplatser. Problem uppstår när en applikation redan är utvecklad och test ej har skrivits under utvecklingens gång. Detta gör det näst intill omöjligt att validera koden utan att spendera hundratals timmar på att skriva enhetstest vilket är ett problem när ingenjörer kostar mycket pengar. Det är då i ett företags intresse att hitta sätt att skriva test som täcker större delar av applikationen.

People Domain teamet på IKEA har utvecklat en applikation, där behovet av tester upptäckts först efter... (More)
Vid utveckling av stora applikationer använder sig många företag av tekniker så som testdriven utveckling för att skapa en stor samling av test som de sedan kan använda sig av för att validera skriven kod. Detta har blivit standarden på många arbetsplatser. Problem uppstår när en applikation redan är utvecklad och test ej har skrivits under utvecklingens gång. Detta gör det näst intill omöjligt att validera koden utan att spendera hundratals timmar på att skriva enhetstest vilket är ett problem när ingenjörer kostar mycket pengar. Det är då i ett företags intresse att hitta sätt att skriva test som täcker större delar av applikationen.

People Domain teamet på IKEA har utvecklat en applikation, där behovet av tester upptäckts först efter att stora delar av applikationen redan är färdiga. Därför undersöker och implementerar detta examensarbete, i samråd med IKEA, tester till ett särskilt flöde i applikationen. Målet med examensarbetet är att implementera ett automatiskt testflöde som körs när en utvecklare lägger till ny kod i applikationen. Applikationen är utvecklad av IKEA för att underlätta hur medarbetare kan påverka sina arbetstider. Detta görs genom att lägga in önskemål för vilka tider man vill och inte vill arbeta.

Då det inte fanns någon tidigare testning av användargränssnittet från IKEA så blev detta ett nytt område att utforska. Det visade sig vara svårare än först beräknat att automatisera hela flödet, vilket berodde på problem med att autentisera användare. Autentiseringen sker via Microsofts portal, vilket gör att det är inte själva applikationen som autentiserar. Problemet visade sig ligga i hur applikationen sedan hanterade autentiseringen från Microsoft. Detta hade krävt en större refaktorisering av applikationens struktur. För att kunna implementera detta testflöde undersöktes ett antal olika ramverk och bibliotek som sedan utvärderas och val gjordes för de som ansågs passa IKEAs behov bäst. Med en kombination av möten, intervjuer samt litteraturstudier inhämtades information, dels om applikationen och dels om testning av mjukvara.

Examensarbetet resulterar i ett testramverk som automatisk testar delar av applikationen. Testerna är skrivna med hjälp av ramverket Cypress, och testar funktionaliteten för att lägga in ett önskemål om arbetstid. (Less)
Please use this url to cite or link to this publication:
author
Wulf, Johan LU and Svensson Fahlström, Erik LU
supervisor
organization
alternative title
Automatiserade funktionstester för en webbtjänst
course
EITL05 20221
year
type
M2 - Bachelor Degree
subject
keywords
Test, automation, single sign on, frameworks, JavaScript
report number
LU/LTH-EIT 2022-878
language
English
id
9092785
date added to LUP
2022-06-23 12:19:02
date last changed
2022-06-23 12:19:02
@misc{9092785,
  abstract     = {{When developing a large application, many companies use techniques such as Test Driven Development in order to get a range of tests on which they later can validate their code with. This has become the standard in many work environments. Problems arise when an application is already developed and tests has not been written in the course of the development. This makes it near impossible to validate the entire code base without spending hundreds of hours writing unit tests which is a problem when engineers costs a lot of money. It is in a companies interest to then find ways to write tests that cover larger parts of an application.

The People Domain team at IKEA has developed an application, where the need for tests was brought to light first when large parts of the application already was developed. This is why this thesis, in coordination with IKEA, investigates and implements an automatic test flow which is run when a developer pushed code to the applications repository. The application is developed by IKEA to make it easier for co-workers to effect their schedule. This is done by creating time slots which are used as requests for when someone want, or does not want, to work.

Since there were no previous tests of the UI made by IKEA, this was a new area to discover. It became apparent that it was harder to automate the entire test flow than first believed. This due to problems with the way that the application authenticates users. The authentication is done through Microsofts portal, which means that it is not the application itself that authenticates. It would require a large re-factorization of the applications structure to make tests work as wanted. To implement the test flow, a number of frameworks and libraries were investigated and evaluated and choices were made for the solutions that seemed to fit IKEAs needs the best. With a combination of meetings, interviews and literature studies information was gathered, both about the application and about the testing of software.

The thesis concludes in a test suite which automatically tests parts of the application. The tests are written with help from the test framework Cypress, and tests the functionality to create a new time slot.}},
  author       = {{Wulf, Johan and Svensson Fahlström, Erik}},
  language     = {{eng}},
  note         = {{Student Paper}},
  title        = {{Automated Functional Tests for a Web Application}},
  year         = {{2022}},
}