Lecture 4 Flashcards
How is end-2-end testing different from unit and integration testing?
It tests actual user scenarios by triggering a workflow, whereas unit/integration testing only tests single methods/actions
What type of test often uses scenarios performed through a GUI?
End-2-end
What is an example of a user scenario that can be tested on an ecommerce platform?
User logging in, browsing, adding to cart, paying for item
What are the two different general approaches to GUI based test automation?
Recording and programmatic approach
What are the downsides to the recording approach to GUI based test automation?
Limited scalability, customisation, harder to version control
What are the downsides to the programmatic approach to GUI based test automation?
Initial setup slower, requires coding knowledge
How does the inclusion of a GUI create challenges for end-2-end testing?
GUIs are updated often which tests need to keep up with. Working with a GUI are means there are requirements for the timing of input
Apart from GUIs, what are end-2-end tests often relying on which can create challenges?
Databases or third-party APIs that can be unreliable or slow
What are the most popular and well-established tools for end-2-end testing?
Selenium, Cypress, Playwright
Which tool used for end-2-end testing uses the WebDriver API for automating web browsers?
Selenium. Communication between the browser and test code is HTTP which means they can be on different hosts.
What is necessary for Selenium to find different HTML elements?
Defining locators
What is XPath?
An example of a locator used by Selenium to find HTML elements
What kind of testing is Selenium useful for?
Cross browser testing
What is a popular approach to achieve better test design?
The Page Object Model (POM)
What programming pattern for GUI automation involves creating a component representing an application page?
The Page Object programming pattern
The Page Object is defined as a class with what two things?
-A list of graphics elements present
-A way to perform actions on the page
True or false: in the Page Object Model, each page of a website becomes its own object.
False, a page is often divided logically into several objects. Header might be its own object and the search bar another.
How does synchronisation cause problems in end-2-end testing?
Test code typically executes faster than application code and bad synchronisation can cause so called flaky tests because differences in response time that are unrelated to the test code
What are the two options that Selenium offers to synchronise test code?
-Implicit wait: wait for x seconds
-Explicit wait: wait until element appears
What is visual testing?
The automated process of validating the visual appearance of web pages or user interfaces
Visual testing is seen as complementing what?
Functional testing
What are the four key concepts in visual testing?
-Baseline images
-Snapshots
-Visual comparison
-Threshold (of difference)