Skip to main content



      Home
Home » Eclipse Projects » RCP Testing Tool » How to open & brose a Model
How to open & brose a Model [message #1703762] Tue, 04 August 2015 14:06 Go to next message
Eclipse UserFriend
Hello,
just want to open a EMF model (DiffQKit.tca) in an RCP application and test if it is displayed correctly.

When recording the test case it looks very ugly, especially the absolute paths elements
are not nice.

set-dialog-result File "C:\\Users\\slotosch\\Desktop\\TCA\\plugins\\Examples_1.10.3\\DiffQKit.tca"
get-menu "File/Open..." | click
get-editor "DiffQKit.tca" | get-tree
| get-item "file:\\/C:\\/Users\\/slotosch\\/Desktop\\/TCA\\/plugins\\/Examples_1.10.3\\/DiffQKit.tca/Tool Chain Qualification Kit \\(TCL3\\)"

I think I will have to store the model in a Context-Folder.
But how can I simplify the access of the elements?
Any suggestions / examples?

Oscar
Re: How to open & brose a Model [message #1703798 is a reply to message #1703762] Wed, 05 August 2015 01:52 Go to previous messageGo to next message
Eclipse UserFriend
Hi Oscar,

You could try to store it in Workbench Context so it will be imported to AUT workspace and there will be no absolute paths then (they will be automatically recorded as relative ones.)

Kind regards,
Ulyana.
Re: How to open & brose a Model [message #1703909 is a reply to message #1703798] Wed, 05 August 2015 14:40 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ulyana,
we do not have a "workspace" in our RCP, at least we do store the models in file that are located somewhere (using File open / save).

Nevertheless we found a solution, since the examples are contained in the tool ("Example-Plugin"). This can be found during
testing execution and we succeed in opening them.
Also the location of elements can be done (using the caption property).
So my propblem is solved, but was neither easy (my second test), nor I am convinced of my ECL script.
May be someone find's improvements in it:


let [val TCAHOME [get-java-property "user.dir"| str ]] [val EXAMPLE "DiffQKit.tca" ]{
list-plugins | foreach [val item] {
if [$item | get name | matches "de.validas.tca.examples.*"] {
let [val examples [concat $TCAHOME "\\" "plugins" "\\de.validas.tca.examples_"[$item | get version | str ]]] {
echo [concat "using example from " $examples] | log
// use examples folder
set-dialog-result File [concat $examples "\\" $EXAMPLE]
get-menu "File/Open..." | click
get-editor $EXAMPLE | get-tree | expand-all
with [get-editor $EXAMPLE | get-tree] {
expand-all
get-items | foreach {
let [val i -input] {
format "caption: %s" [$i | get-property "caption" -raw] | log
if [$i | get-property "caption" -raw | matches "Tool Chain.*"] {
// show-alert [concat "found it: " [$i | get-property "caption" -raw]]
// check Tool Chain (as captured manually)
$i | get-property caption | equals "Tool Chain Qualification Kit (TCL3)" | verify-true
$i | get-property selection | equals false | verify-true
$i | get-property enablement | equals false | verify-true
$i | get-property index | equals 0 | verify-true
$i | get-property selected | equals false | verify-true
$i | get-property checked | equals false | verify-true
$i | get-property childCount | equals 5 | verify-true
$i | get-property "image.path" | equals "de.validas.tca.edit/icons/full/obj16/ToolChain.gif" | verify-true
$i | get-property "image.decorations[0].path" | equals "de.validas.tca.edit/icons/full/check_constraint.gif" | verify-true
$i | get-property backgroundColor | equals "#FFFFFF" | verify-true
$i | get-property foregroundColor | equals "#000000" | verify-true
$i | get-property "styles[0].start" | equals 0 | verify-true
$i | get-property "styles[0].length" | equals 35 | verify-true
$i | get-property "styles[0].text" | equals "Tool Chain Qualification Kit (TCL3)" | verify-true
$i | get-property "styles[0].fontStyle" | equals normal | verify-true
$i | get-property "styles[0].font" | equals "Segoe UI" | verify-true
}
}
}
}
}
}
}
}
Re: How to open & brose a Model [message #1705452 is a reply to message #1703909] Sat, 15 August 2015 16:56 Go to previous message
Eclipse UserFriend
Yes, the workbench context (with the file from a workspace context) solved my issue.
Thanky for the hint
Previous Topic:Basic ECL is Turing-complete: Here's the proof
Next Topic:Problem with: set-dialog-result Folder?
Goto Forum:
  


Current Time: Tue Jun 24 06:48:43 EDT 2025

Powered by FUDForum. Page generated in 0.26383 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top