Cypress Test Cases Writing Take Aways.

Finally I setup Cypress for the project that I am working on in my company. After wrote several test cases, here is some take aways I want to share.

Stub Network Before Visit

When stubbing the requests for test cases, cypress need to know about the routes before the reqeusts being made from the app you are testing.

This is crucial for the initial requests that your app will emit to load initial data used to boot up.

Continue reading →

Python Xero Integration Setup

I got a task about Xero integration in my work last week, aiming to copy invoices from one account to the other. To perform this task, the workflow will be:

    1. Invoice created/updated in Xero account A
    1. The webhook from Xero account A is triggered
    1. Our App handles the webhook and copy the newly created/updated invoice to Xero account B

This article will show you how to setup Xero and talk about some tricky parts of the task.

Continue reading →

Cypress: UI Test For Your React/Webpack Project

UI Test has been a problem for every web front end project once it grows and becomes rather complicated while the common unit tests fail to cover complex workflow and business logic.

UI Test in this artile, I would say it’s more like integration test, but I would not put it as E2E test, since I have no intention to test the real backend. So the things that I am going to talk about in this article, are “login and redirect to the home page”, “sign up and redirect to the home page”, “create a query in the dashboard and see if the result is correctly rendered” and all sort of stuff that a unit test is unable to cover.

Continue reading →

《如何阅读一本书》 笔记





Continue reading →

Review: The Spare Room

Story Brief

The author (Helen) had her fifteen-year friend Nicola from Sydney staying in her spare room in Melbourne for three weeks. Nicola was there for a Vitamin C Treatment claiming to cure her cancer, while Helen had to care for her.

Nicola had never been married and had no children. She was what called Bohemian.

She was obsessed with alternative treatments and theories, even they all seemed to be deceptive to Helen. The side effects of the treatment gave Nicola a lot of bad nights but she made herself believed that it was the proof of the cancer being reduced, while at the same time, Helen had to spend all those sleepless nights taking care of Nicola and holding back to not hurt Nicola by pointing out the truth of the false treatment.

The days went on until Helen could no longer stand and confronted Nicola. Helen pushed her to face the truth: She was going to die.

Continue reading →