Skip to content

Commit 1338620

Browse files
authored
Merge pull request #36 from dp2020-dev/blog_content
Blog content
2 parents fac78fc + 7ae1582 commit 1338620

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

_posts/2023-10-28-compare-cypress-playwright.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Alongside Selenium, Cypress and Playwright are currently amongst the most widely
99

1010
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.
1111

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.
1313
1414
### Test Plan
1515

@@ -22,7 +22,7 @@ To compare these test tools, I used the [5W](https://testiotech.com/2024/01/26/5
2222
<li>Add to Basket and Checkout: Check the functionality of adding items to the basket and completing the checkout process.</li>
2323
</ul>
2424

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).
2626

2727
### Setting up Cypress and run tests
2828

@@ -32,7 +32,7 @@ The documentation on installing Cypress itself is pretty user friendly, so rathe
3232

3333
> &#9432; 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.
3434
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:
3636

3737
{% highlight js %}
3838
npx cypress open
@@ -46,7 +46,7 @@ Once cypress is up and running in the browser, my approach was to follow the Get
4646

4747
#### Setting the baseURL
4848

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.
5050

5151
{% highlight js %}
5252
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
8383
{% gist dc6175465df73d5c706268bf8add1429 %}
8484

8585
In addition to Cypress documentation, this blog proved useful in understand more about Cypress Fixtures:
86-
[https://testersdock.com/cypress-fixtures/(https://testersdock.com/cypress-fixtures/)]
86+
[https://testersdock.com/cypress-fixtures/](https://testersdock.com/cypress-fixtures]
8787

8888
#### Time Travel
8989

90-
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.
9191

9292
Lets demonstrate this by looking at an E2E test that uses our baseUrl set in config, and some of our imported fixture data.
9393

9494
##### Example
9595

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.
9797

9898
![Passing E2E run in Cypress browser view](/images/1_test_passes.png)
9999

_posts/2024-01-26-5W-Framework.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ Therefore the ability to self-learn and learn ‘on the job’ is a key skill fo
1111

1212
### Why do we need a framework?
1313

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.
1515

1616
### What is the 5W?
1717

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:
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:
1919

2020
Apply 5 W framework to get a more relevant response (the example I've used here is to learn Selenium):
2121
<strong>
@@ -39,7 +39,7 @@ Based on this example, this gives us the following prompt to input into the LLM:
3939
<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.
4040
Suggest reliable web resources that can be easily found through a web search or by directly visiting the official websites.</strong>
4141

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.
4343

4444
![An example response, 'How to use ChatGPT for your own study plan', January 2024](/images/sampleResponse.jpg)
4545

@@ -50,15 +50,15 @@ Some of the advantages of using this framework in ChatGPT (or another LLM):
5050
<ul>
5151

5252
<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>
5555
</ul>
5656

5757
### Talks
5858

5959
![Test Talks Wales, 'How to use ChatGPT for your own study plan', January 2024](/images/TTW_January2024.jpg)
6060

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/).
6262

6363
![MoT Newcastle Group, 'How to use ChatGPT for your own study plan', JMarch 2024](/images/MoT_Newcastle.webp)
6464

0 commit comments

Comments
 (0)