You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2023-10-28-compare-cypress-playwright.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Alongside Selenium, Cypress and Playwright are currently amongst the most widely
9
9
10
10
To evaluate these tools myself, I set up [a Git repo](https://github.com/dp2020-dev/blazemeter-ecommerce-automated-tests) to do some basic UI automation, one using Cypress the other Playwright to compare them side by side (I will add Selenium Webdriver soon). If you can set up these tools locally, you will be able to follow and implement the simple test plan outlined below, or alternatively clone the material in the repo itself and run it.
11
11
12
-
> ⓘ For reference, I installed both tools on a Mac, and the system under test/code used was Javascript, however the instructions I link to cover Windows/Linux, other code bases etc.
12
+
> ⓘ For reference, I installed both tools on a Mac, and the system under test/code used was JavaScript. However, the instructions I link to cover Windows/Linux and other code bases.
13
13
14
14
### Test Plan
15
15
@@ -22,7 +22,7 @@ To compare these test tools, I used the [5W](https://testiotech.com/2024/01/26/5
22
22
<li>Add to Basket and Checkout: Check the functionality of adding items to the basket and completing the checkout process.</li>
23
23
</ul>
24
24
25
-
The system under test used here ([https://www.demoblaze.com](https://www.demoblaze.com)) has proven to be really suited for e-commerce UI testing, but you of course may have a preferred alternative (generally we'll be covering standard e-commerce transactions).
25
+
The system under test used here ([https://www.demoblaze.com](https://www.demoblaze.com)) has proven to be well suited for e-commerce UI testing, but you of course may have a preferred alternative (generally we'll be covering standard e-commerce transactions).
26
26
27
27
### Setting up Cypress and run tests
28
28
@@ -32,7 +32,7 @@ The documentation on installing Cypress itself is pretty user friendly, so rathe
32
32
33
33
> ⓘ If you see a <b> 'Cypress Configuration Error'</b> when running 'npx cypress open' , ensure you are running cypress from the right folder level, it needs to be in a folder above the cypress.config.js level to avoid any config errors.
34
34
35
-
Provided the installation has been successful, my prefered approach is to open a command line/terminal in the project folder, and run:
35
+
Provided the installation has been successful, my preferred approach is to open a command line/terminal in the project folder, and run:
36
36
37
37
{% highlight js %}
38
38
npx cypress open
@@ -46,7 +46,7 @@ Once cypress is up and running in the browser, my approach was to follow the Get
46
46
47
47
#### Setting the baseURL
48
48
49
-
For UI tests its very useful to not have to explicitly use the url of the system under test (e.g. www.demoblaze.com). We can define the baseUrl in the cypress.config.js in project root. Cypress calls this base url when '/' is used in an E2E test, e.g.
49
+
For UI tests it's very useful to not have to explicitly use the url of the system under test (e.g. www.demoblaze.com). We can define the baseUrl in the cypress.config.js in project root. Cypress calls this base url when '/' is used in an E2E test, e.g.
50
50
51
51
{% highlight js %}
52
52
cy.visit('/') // uses the baseUrl (i.e. www.demoblaze.com in our example) in the cypress.config to open the url.
@@ -83,17 +83,17 @@ This class is used in E2E tests, e.g. in E2EloginPurchases test file, we get the
83
83
{% gist dc6175465df73d5c706268bf8add1429 %}
84
84
85
85
In addition to Cypress documentation, this blog proved useful in understand more about Cypress Fixtures:
The time travel feature is effectively a record of the changing state of the system under test, which has proven to be invaluable to understand how the website behaves in response to our test inputs, and to debug.
90
+
The time travel feature is effectively a record of the changing state of the system under test, which has proven to be invaluable in understanding how the website behaves in response to our test inputs and for debugging.
91
91
92
92
Lets demonstrate this by looking at an E2E test that uses our baseUrl set in config, and some of our imported fixture data.
93
93
94
94
##### Example
95
95
96
-
The [E2Eloginpurchases](https://github.com/dp2020-dev/blazemeter-ecommerce-automated-tests/blob/main/cypress/e2e/E2EloginPurchases.cy.js) E2E test verifies the log in process works with a valid username/password, and checks a successful log in message appears on screen.
96
+
The [E2EloginPurchases](https://github.com/dp2020-dev/blazemeter-ecommerce-automated-tests/blob/main/cypress/e2e/E2EloginPurchases.cy.js) E2E test verifies the log in process works with a valid username/password, and checks a successful log in message appears on screen.
97
97
98
98

Copy file name to clipboardExpand all lines: _posts/2024-01-26-5W-Framework.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,11 @@ Therefore the ability to self-learn and learn ‘on the job’ is a key skill fo
11
11
12
12
### Why do we need a framework?
13
13
14
-
This is a simple technique which forces us to think through what information and material we want out of the LLM. This will give us a structure to both our prompts, and the response we get back.
14
+
This is a simple technique that forces us to think through what information and material we want from the LLM. This will give us a structure to both our prompts and the response we get back.
15
15
16
16
### What is the 5W?
17
17
18
-
This technique is from an excellent blog by Tina Huang, and is originally based on learning a programming language but is equally applicable to testrelated learning:
18
+
This technique is from an excellent blog by Tina Huang, and is originally based on learning a programming language but is equally applicable to test-related learning:
19
19
20
20
Apply 5 W framework to get a more relevant response (the example I've used here is to learn Selenium):
21
21
<strong>
@@ -39,7 +39,7 @@ Based on this example, this gives us the following prompt to input into the LLM:
39
39
<strong>Act as a coding tutor to create a study plan to help me learn Selenium using Java to be able to create automated tests for front end e-commerce systems. I can study for up to 6 hours a week for 8 weeks, and prefer interactive, example based free resources.
40
40
Suggest reliable web resources that can be easily found through a web search or by directly visiting the official websites.</strong>
41
41
42
-
The above style of prompt should give a structured plan based in the 5W <i>what</i>, in the timelines defined in the <i>when</i>. I’ve found this approach helpful when learning Cypress for example.
42
+
The above style of prompt should give a structured plan based on the 5W <i>what</i>, in the timelines defined in the <i>when</i>. I’ve found this approach helpful when learning Cypress for example.
43
43
44
44

45
45
@@ -50,15 +50,15 @@ Some of the advantages of using this framework in ChatGPT (or another LLM):
50
50
<ul>
51
51
52
52
<li>Gives a structured plan, with suggested resources.</li>
53
-
<li>Its adaptable- if our focus or timelines change, we can change the study plan.</li>
54
-
<li>Relevant- we can add or remove topics/elements of the plan where necessary (not possible in an ‘off the shelf’ course)</li>
53
+
<li>It's adaptable- if our focus or timelines change, we can change the study plan.</li>
54
+
<li>Keeps it relevant- we can add or remove topics/elements of the plan where necessary (not possible in an ‘off the shelf’ course)</li>
55
55
</ul>
56
56
57
57
### Talks
58
58
59
59

60
60
61
-
As mentioned above I’ve personally used this framework as part of our development and learning in BJSS Test & Assurance, and it’s the basis of a talk I’ve presented at [Test Talks Wales](https://www.meetup.com/test-talks-wales/events/298323939/), [South West Test](https://www.meetup.com/south-west-test/events/301151914/) and [Ministry of Testing Talks Newcastle](https://www.meetup.com/mot-newcastle/events/298859530/).
61
+
As mentioned above, I’ve used this framework both personally and as part of development and learning professionally in work, and it’s the basis of a talk I’ve presented at [Test Talks Wales](https://www.meetup.com/test-talks-wales/events/298323939/), [South West Test](https://www.meetup.com/south-west-test/events/301151914/) and [Ministry of Testing Talks Newcastle](https://www.meetup.com/mot-newcastle/events/298859530/).
62
62
63
63

0 commit comments