Last modified: May 16, 2024


App for automated test

Change of name app This is an app which should only be used to run automated tests against. It contains these components: Title Input Textarea Checkbox Radio button Attachment Datepicker Button Rules The rules appends the text from the text feilds for new first, middle and last name and displays in a new field. The relevant code: nyttNavn: (obj) => { obj.fornavn = obj.fornavn ? obj.fornavn + ' ' : ''; obj. »


Cypress is a next generation front end open-source testing tool built for the modern web. Read more about Cypress here. Prerequisite Cypress lists the requirement for the tests here. Run the tests Cypress test project has a simple read me which describes how one can install the dependencies, start the solution and run the tests. Altinn Studio tests git clone The tests on altinn studio are run from an azure devops pipeline and the results are recorded in cypress dashboard with tag: altinn-studio. »


k6 is a developer-centric, free and open-source load testing tool built for making performance testing a productive and enjoyable experience. read more about K6 here Set up k6 tests Clone the k6 tests from GitHub Repo Install docker and make sure the drive having the k6 tests is shared. Open cmd and download the latest k6 docker image docker pull loadimpact/k6 How to write k6 tests Find the area/collection where the new test has to be added. »


Postman To test API endpoints the tool postman enables easy configuration and setup of various HTTP requests, read more about postman here. Authentication Several of the exposed APIs requires various cookies, for instance authentication and gitea information. To be able to do requests against these APIs the cookies have to be included in the HTTP request, and configured in postman. The cookies can be found in the following way: In your browser login to dev. »


Coding guidelines for tests App for automated testAn app used solely for automated testing in the browser CypressFunctional Testing of Altinn Studio and Altinn app-frontend with Cypress k6Performance and Functional Testing of API with K6 PostmanAPI Testing with postman Test StrategyTest Strategy Unit testing with JestHow to write jest test in altinn studio, what we know so far. This page summarizes how UI testing is performed with Jest and related libraries for Altinn Studio. »

Test Strategy

What should be tested? In tjenester 3.0, there is a need for both testing Altinn Studio, the app designer, as well as testing apps that are developed by an app developer in Altinn Studio Runtime. Testing these two areas of Altinn Studio requires different approaches. Testing of Altinn Studio is to be tested automatically at the unit and integration levels of testing. Unit testing of the system involves, for example, the testing of individual javascript functions, and individual pieces of logic relating to react/UI components. »

Unit testing with Jest

When should you write tests? Unit testing includes testing of javascript functions and react/UI components. Listing of the highest priority of unit-testing: API calls with the correct formatted parameters Rendering of isolated components. Functions in general. Exporting and importing your component A quick way to get started testing your component is first to export the React Component: export class CloneServiceComponent extends React.Component<ICloneServiceComponentProps & RouteChildrenProps, ICloneServiceComponentState> { and then reference it in your test the following way: »