Status | ||||
---|---|---|---|---|
|
After defining a functional journey, it’s time to write!
Download the template in available on Gitlab Greenspector Studio/ Modules / GDSL Templates Examples
Choose the appropriate file according to the for your project: Web, Android, iOS
Move them in a project folder
Modify
{{.PackageName}}
[PACKAGE]
by the package name of your application, as the example below:
Code Block |
---|
applicationKill,com.facebook.katana |
Code Block |
---|
applicationStart,com.facebook.katana |
Expand | ||
---|---|---|
| ||
For a website, the package is the browser package: For applications, 3 possible methods:
|
To learn about GDSL script structure, go on Introduction to GDSL
To launch the application
Measure reference inactivity on home screen
Launch the application
Wait for the last element to display (
waitUntil
)
Code Block |
---|
measureStart,PAUSE_reference pause,${PAUSEDURATION} measureStop measureStart,CHRGT_homePage applicationStart,com.google.android.youtube waitUntilText,Home pause,${PAUSEAFTERLOAD} measureStop |
To launch a website:
Launch the browser (
setBrowser
)Prepare the browser by clearing cache and history (
browserPrepareAndOpenForReference
)Measure the reference inactivity of an empty tab
Writing of URL (
browserGoToUrl
)Measure the load of the website validating the URL (
pressEnter
)Wait for the last element to display (
waitUntil
)
Code Block |
---|
setBrowser,chrome applicationKill,com.android.chrome browserPrepareAndOpenForReference measureStart,PAUSE_referenceBrowser pause,${PAUSEDURATION} measureStop browserGoToUrl,https://metropole.nantes.fr measureStart,CHRGT_homePage pressEnter waitUntilText,accept all pause,${PAUSEAFTERLOAD} measureStop |
Note |
---|
If, on installation, the application displays windows that do not appear in the follo
|
For each new view/page :
Do the action allowing to change view (
clickBy
)Wait for the last element to display (
waitUntil
)Verify the element waited doesn’t already exist before change view (
assertNotExists
)Implement a pause step to measure inactive state
Code Block |
---|
assertNotExistsText,Enjoy your favourite videos measureStart,CHRGT_libraryTab clickByTextExact,Library waitUntilTextExact,Enjoy your favourite videos pause,${PAUSEAFTERLOAD} measureStop measureStart,PAUSE_libraryTab pause,${PAUSEDURATION} measureStop |
To get element characteristics in a view, go on Get elements of a view (Android)
For an action (click, write text, ..) or scroll :
Do 3 actions maximum in one measure
Separate them by appropriate pause (
PAUSEAFTERACTION
andPAUSEAFTERSCROLL
)
Action :
Code Block |
---|
measureStart,ACTION_homePage_writeResearch clickByPercent,80,5 pause,${PAUSEAFTERACTION} enterText,greenspector pause,${PAUSEAFTERLOAD} measureStop |
Scroll :
Code Block |
---|
measureStart,SCROLL_videos swipeVertical,90,10,50 pause,${PAUSEAFTERSCROLL} swipeVertical,10,90,50 pause,${PAUSEAFTERLOAD} measureStop |
For end technical steps (reliable for apps)
Come back on device home to measure app activity in background in a pause (
pressHome
)Measure app activity after user close in a pause (
applicationCloseAll
)Measure app activity after forced close (process close) in a pause (
applicationKill
)
Code Block |
---|
pressHome measureStart,PAUSE_appBackground pause,${PAUSEDURATION} measureStop applicationCloseAll measureStart,PAUSE_afterUserClose pause,${PAUSEDURATION} measureStop applicationKill,com.android.chrome measureStart,PAUSE_afterForcedClose pause,${PAUSEDURATION} measureStop |
To implement good practices check : Good Best practices and tips