Lecture 4 Flashcards

1
Q

How is end-2-end testing different from unit and integration testing?

A

It tests actual user scenarios by triggering a workflow, whereas unit/integration testing only tests single methods/actions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What type of test often uses scenarios performed through a GUI?

A

End-2-end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an example of a user scenario that can be tested on an ecommerce platform?

A

User logging in, browsing, adding to cart, paying for item

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the two different general approaches to GUI based test automation?

A

Recording and programmatic approach

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the downsides to the recording approach to GUI based test automation?

A

Limited scalability, customisation, harder to version control

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the downsides to the programmatic approach to GUI based test automation?

A

Initial setup slower, requires coding knowledge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does the inclusion of a GUI create challenges for end-2-end testing?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Apart from GUIs, what are end-2-end tests often relying on which can create challenges?

A

Databases or third-party APIs that can be unreliable or slow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the most popular and well-established tools for end-2-end testing?

A

Selenium, Cypress, Playwright

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which tool used for end-2-end testing uses the WebDriver API for automating web browsers?

A

Selenium. Communication between the browser and test code is HTTP which means they can be on different hosts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is necessary for Selenium to find different HTML elements?

A

Defining locators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is XPath?

A

An example of a locator used by Selenium to find HTML elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What kind of testing is Selenium useful for?

A

Cross browser testing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a popular approach to achieve better test design?

A

The Page Object Model (POM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What programming pattern for GUI automation involves creating a component representing an application page?

A

The Page Object programming pattern

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The Page Object is defined as a class with what two things?

A

-A list of graphics elements present
-A way to perform actions on the page

17
Q

True or false: in the Page Object Model, each page of a website becomes its own object.

A

False, a page is often divided logically into several objects. Header might be its own object and the search bar another.

18
Q

How does synchronisation cause problems in end-2-end testing?

A

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

19
Q

What are the two options that Selenium offers to synchronise test code?

A

-Implicit wait: wait for x seconds
-Explicit wait: wait until element appears

20
Q

What is visual testing?

A

The automated process of validating the visual appearance of web pages or user interfaces

21
Q

Visual testing is seen as complementing what?

A

Functional testing

22
Q

What are the four key concepts in visual testing?

A

-Baseline images
-Snapshots
-Visual comparison
-Threshold (of difference)