Skip to content

This repository can be used to provide pre-defined code and xml snippets for writing Maveryx test classes in the Eclipse IDE.

Notifications You must be signed in to change notification settings

Maveryx/maveryx-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

maveryx-snippets

This is an Eclipse Code Recommender Snipmatch Snippet repository for Maveryx Test Automation Framework by Maveryx S.r.l.

This repository can be used to provide pre-defined code snippets for writing Maveryx test classes in the Eclipse IDE.

Installation

Eclipse Code Recommenders comes pre-installed in every Eclipse release since the Mars release in 2015.

Open the Preferences -> Code Recommenders -> Snipmatch preference page and click the New button:

Eclipse Snipmatch Preferences

Select Git-Based Snippet Repository from the list of Snippet Repository Types and click the Next > button:

Eclipse Snipmatch select repo type

Fill in the configuration form exactly as shown below and click the Finish button:

Eclipse Snipmatch Configure Snippet Repository

This repository is now set up correctly, click the OK button:

Eclipse Snipmatch Maveryx repository

Use

Please take a moment to read these general instructions on how to use Eclipse Snipmatch if you are not familiar with it.

Press Ctrl + Alt + Space in a Java editor in Eclipse to open the Snipmatch search box view. Search for a Maveryx snippet by name or keyword. Or view all Maveryx snippets by searching for the maveryx tag by typing tag:maveryx in the search box.

Contributions

Please raise an issue in the repository issues list to suggest a new snippet idea.

Or, even better, fork this repository, commit a new snippet definition then send a pull request!

Please note that Snipmatch repositories have a specific branch structure that must be adhered to in order to work properly in Eclipse.

Authoring a new snippet

The process is that you create and test a snippet locally, then upload it to a configured Snipmatch repository.

Select the Window -> Show View -> Other... menu option then select the Code Recommenders -> Snippets View. NB: Do not select the identically-named General -> Snippets view by mistake:

Open Code Recommenders Snippets View

In the Snippets View, select the "Maveryx Snippets repository" repo (as configured in the Installation section above):

Code Recommenders Snippets View

Right click on the "Maveryx Snippets repository" folder and select the Add Snippet to... context menu entry:

Code Recommenders Snippets View

The Snipmatch Snippet Editor is now displayed. Fill in the meta data similar to the example in the screenshot below. Don't forget the maveryx tag. For more information on how to use this editor, see the Eclipse.org Snipmatch Editor documentation:

Snippet Editor Metadata tab

Click on the Raw Source tab at the bottom of the Snippet Editor. This is where you add the actual code for the snippet. If you adding Java code, you can also select existing code from a Java Editor, right-click and select the Create Snippet... option. Take a look at the Raw Source documentation for more information and links to the JFace template language used by Snipmatch:

Snippet Editor Raw Source tab

Hit Ctrl+S in the Snippet Editor to save the newly-defined snippet. It is now available to try out in your Eclipse editor.

When you are happy that the snippet is working as you desire, if you have write permission to the configured Maveryx Snippets repository, you can upload it directly from the Snippets View. Locate the newly - created snippet in the Snippets View, right-click and select Share Snippet(s)... (NB: you can multi-select more than one snippet to upload in one commit):

Snippets View - Share Snippet

Fill in the commit details on the Commit Changes window then click the Commit button:

Commit Changes

You will then be prompted with the url of the repository (should be filled in for you), enter your username and password credentials for the git repository and click the OK button:

Git Login

If the commit was successful, you will see this final message:

Upload snippet success

License

The contents of this repository are provided under the MIT license. See LICENSE for more details.

About

This repository can be used to provide pre-defined code and xml snippets for writing Maveryx test classes in the Eclipse IDE.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published