Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
It's a (testing) trap! - Common testing pitfall...
Search
Ramona Schwering
June 08, 2021
Programming
540
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
It's a (testing) trap! - Common testing pitfalls and how to solve them
Ramona Schwering
June 08, 2021
More Decks by Ramona Schwering
See All by Ramona Schwering
Artful Defense
leichteckig
0
48
a11y club: The Cake Is a Lie... And So Is Your Login’s a11y.
leichteckig
0
20
Dangerous Reactivity: Why AI Output Is the New XSS Vue
leichteckig
0
35
React with Caution: How to Hack Your React App (And Fix It Too)
leichteckig
0
24
Vue'tiful Defense
leichteckig
0
140
Workshop: The Cake is a Lie!
leichteckig
0
42
The Cake Is a Lie... And So Is Your Login’s Accessibility
leichteckig
0
230
Plants vs thieves: Automated Tests in the World of Web Security
leichteckig
0
230
From the Crypt to the Code
leichteckig
0
260
Other Decks in Programming
See All in Programming
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
160
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
450
Building an Out-of-Order CPU
latte72
1
790
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
330
Heart of Swift Concurrency
koher
0
940
The Rails Doctrine Decade
koic
2
190
What We Talk About When We Talk About XP
m_seki
2
660
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.7k
AHC070解法紹介
eijirou
0
130
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
200
iOSDC2026登壇資料.pdf
riofujimon
0
170
新卒PdEのリアル
ryu1013
1
510
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
GraphQLとの向き合い方2022年版
quramy
50
15k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
730
Mobile First: as difficult as doing things right
swwweet
225
10k
The SEO Collaboration Effect
kristinabergwall1
1
570
Product Roadmaps are Hard
iamctodd
55
13k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Building an army of robots
kneath
307
46k
Google's AI Overviews - The New Search
badams
0
1.6k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
530
Transcript
None
None
None
None
None
None
None
None
None
None
None
None
None
describe('deprecated.plugin', () => { it('should throw error',() => { …
}); });
describe('deprecated.plugin', () => { it('Property: Should throw an error if
the deprecated prop is used', () => { … }); });
None
describe('Context menu', () => { it('should open the context menu
on click', async () => { const wrapper = createWrapper(); expect(wrapper.vm).toBeTruthy(); await wrapper.trigger('click'); const selector = '.sw-context-menu'; expect(wrapper.find(selector).isVisible()).toBeTruthy(); }); });
describe('Context menu', () => { it('should open the context menu
on click', () => { }); });
describe('Context menu', () => { it('should open the context menu
on click', () => { }); }); // Arrange const wrapper = createWrapper(); const selector = '.sw-context-menu';
describe('Context menu', () => { it('should open the context menu
on click', () => { }); }); // Arrange const wrapper = createWrapper(); const selector = '.sw-context-menu'; // Act await wrapper.trigger('click');
describe('Context menu', () => { it('should open the context menu
on click', () => { }); }); // Arrange const wrapper = createWrapper(); const selector = '.sw-context-menu'; // Act await wrapper.trigger('click'); // Assert expect(wrapper.vm).toBeTruthy(); expect(wrapper.find(selector).isVisible()).toBeTruthy();
None
None
“…arrange my test == what I’m given.”
“…arrange my test == what I’m given.” “…act in my
test == when something happens.”
“…arrange my test == what I’m given.” “…act in my
test == when something happens.” “…assert the results == something happens then this is what I expect as the outcome.”
“…arrange my test == what I’m given.” “…act in my
test == when something happens.” “…assert the results == something happens then this is what I expect as the outcome.”
describe('Context menu', () => { it('should open the context menu
on click', () => { // Given const contextButtonSelector = 'sw-context-button'; const contextMenuSelector = '.sw-context-menu'; // When let contextMenu = wrapper.find(contextMenuSelector); expect(contextMenu.isVisible()).toBe(false); const contextButton = wrapper.find(contextButtonSelector); await contextButton.trigger('click'); // Then contextMenu = wrapper.find(contextMenuSelector); expect(contextMenu.isVisible()).toBe(true); }); });
None
None
it('should create and read product', () => { … cy.get('.sw-field—product-name').type('T-Shirt
Ackbar'); cy.get('.sw-select-product__select_manufacturer') .type('Space Company’); … });
it('should create and read product', () => { … cy.get('.sw-field—product-name').type('T-Shirt
Ackbar'); cy.get('.sw-select-product__select_manufacturer') .type('Space Company’); … });
None
None
None
Cypress.Commands.add('typeSingleSelect', { prevSubject: 'element', }, (subject, value, selector) => {
… cy.wait(500); cy.get(`${selector} input`) .type(value); });
None
None
None
None
None
None
None