Skip to content

Instantly share code, notes, and snippets.

@ElMassimo
Created August 6, 2018 16:49
Show Gist options
  • Save ElMassimo/0f3be42c04ff4528edde49f938f5f9f7 to your computer and use it in GitHub Desktop.
Save ElMassimo/0f3be42c04ff4528edde49f938f5f9f7 to your computer and use it in GitHub Desktop.
Cypress Matcher
<snippet>
<content><![CDATA[
import { createMatcher } from '@support/MatchersHelper'
export default createMatcher('${TM_FILEPATH/.*?(\w+).js/\1/}', {
// Selectors: Semantic aliases for elements, a very useful abstraction.
selectors: {$1
},
// Getters: A convenient way to get nested elements in the component.
getters: {$2
},
// Actions: Encapsulate complex actions to provide a cleaner interface.
actions: {$3
},
// Assertions: Allow to check on element properties while keeping it DRY.
assertions: {$4
},
})
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>matcher</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<description>Cypress Test Matcher</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment