Endtest

Endtest

›All blog posts

All blog posts

  • Version 100 of Chrome, Edge, and Firefox may break your website
  • What Happens When You Don't Test in Safari
  • 5 Reasons Why You Should Perform Geolocation Testing
  • 5 Reasons Why You Should Always Test on Safari
  • Top 5 Alternatives to Selenium
  • 5 Myths About Codeless Automation
  • No-code test automation
  • Selenium vs Cypress
  • Endtest vs Ghost Inspector
  • Puppeteer vs Selenium
  • A Practical Guide for Finding Elements with Selenium
  • 8 Extremely Useful HTML Tricks
  • 8 Extremely Powerful JavaScript Hacks
  • Endtest vs Sauce Labs
  • Endtest vs BrowserStack
  • 10 Ways To Improve Your Automated Tests

What Happens When You Don't Test in Safari

February 18, 2022

I decided to write about a major bug I recently encountered in our platform.

In Endtest, there is a section where users can view the test execution logs:

endtest test execution logs

It's a critical component, and that's where it occurred.

1. The Bug

We recently made a change to improve the timestamps.

In our database, we store all the timestamps in UTC time zone, in a basic format:

2022-02-10 07:31:15

And we wanted to display the timestamps in a more friendly way, while also converting them to the time zone of the user:

February 10, 2022, 14:31:15

This was being done in the frontend, with some vanilla JavaScript.

It worked great in Chrome, Edge and Firefox, but not in Safari:

endtest safari bug

2. The Fix

The issue was coming from this line:

unixTimestamp = new Date(the_timestamp).getTime() / 1000 - (diff*60);

As you can see, it's a really basic one, nothing fancy or risky.

Turns out Safari has an issue with spaces in timestamps, and the solution is to replace each space with a T, like this:

the_timestamp = the_timestamp.replace(' ', 'T');

3. The Lesson

No unit or Jest test could have captured this issue.

The only way to detect such an issue is to run functional tests in Safari.

This shows us that a browser is more than just a JavaScript interpreter.

And that cross-browser testing is more relevant than ever.

4. The Rise of Safari

More and more folks are using Safari, they're loving the privacy-focused aspect of it.

browser stats 2022

Not testing on Safari means that you might be ignoring 20% of your users.

I'm also using it, but only on my phone. Chrome is still my desktop browser.

5. The Democratization of Automated Testing

We've always advocated for testing in multiple browsers, that's why Safari was always an option in our platform:

endtest browsers

By providing browsers in the cloud, anyone can run tests on Safari, regardless of what operating system they're using.

And by proving a low-code interface, anyone can create automated tests in a few minutes, even without writing code.

The Test Automation space has always had its fair share of gatekeepers, and we're getting them out of the way.

Recent posts
  • 1. The Bug
  • 2. The Fix
  • 3. The Lesson
  • 4. The Rise of Safari
  • 5. The Democratization of Automated Testing
Copyright © 2022 Endtest