blob: 40235f1f4a6ef43d6a6b9c6e3b1a877de373cafe [file] [log] [blame]
<!DOCTYPE html>
<head>
<title>RCPTT Documentation Center</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://www.eclipse.org/rcptt/shared/css/bootstrap.min.css">
<link rel="stylesheet" href="https://www.eclipse.org/rcptt/shared/css/main.css">
<link rel="stylesheet" href="https://www.eclipse.org/rcptt/shared/css/prism.css">
<link rel="icon" href="https://www.eclipse.org/rcptt/shared/img/favicon.ico">
<script src="https://www.eclipse.org/rcptt/shared/js/jquery.min.js"></script>
<script src="https://www.eclipse.org/rcptt/shared/js/bootstrap.min.js"></script>
<script src="https://www.eclipse.org/rcptt/shared/js/prism.js"></script>
<script src="https://www.eclipse.org/rcptt/shared/js/ecl.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-39589807-5', 'eclipse.org');
ga('send', 'pageview');
</script>
</head>
<body>
<div id="before-footer">
<header>
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">RCPTT Documentation Center</span>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active" >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/getstarted">User Guide</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/faq/">FAQ</a>
</li>
<li>
<a href="http://eclipse.org/rcptt">Back to RCPTT Main Site</a>
</li>
<li>
<a href="http://eclipse.org">Eclipse.org</a>
</li>
</ul>
</div>
</nav>
</header>
<section class="content">
<div class="container">
<div class="row">
<div class="col-sm-3">
<div class="rcptt-sidebar">
<ul class="nav">
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/getstarted/">Get Started</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/testeditor/">Test Case Editor</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/controlpanel">Control Panel</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/assertions/">Assertions</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/ecl/">Eclipse Command Language</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/ecl/new-command-guide/">New ECL Command Guide</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/ecl/excel-import-export/">ECL commands for Excel import and export</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/ecl/xml-import-export/">ECL commands for XML import and export</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/">Contexts</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/workspace/">Workspace</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/workbench/">Workbench</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/launch/">Launch</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/preferences/">Preferences</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/parameters/">Parameters</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/group/">Group</a>
</li>
<li class="active" >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/folder/">Folder</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/default/">Default</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/super/">Super</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/ecl/">ECL Script</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/">Verifications</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/text/">Text</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/treetable/">Table/Tree</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/errorlog/">Error Log</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/time/">Time</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/procedures/">Procedures and Variables</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/runner/">Test Runner</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/runner/arguments/">Arguments</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/maven/">Maven plugin</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/">RAP</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/install/">Install instructions</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/recordReplay/">Record and Replay</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/capability/">Capability Contexts</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/rap-commands/">ECL commands</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/rap-maven/">Maven plugin</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/integration/">Integration</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/integration/test-rail-integration/">TestRail</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/integration/zephyr-integration/">Zephyr</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="col-sm-9">
<h1>Folder Contexts</h1>
<h3>Introduction</h3>
<p>If you need to prepare your AUT workspace you use a <a href = "https://www.eclipse.org/rcptt/documentation/userguide/contexts/workspace">Workspace context</a> which places files on a workspace before a
test execution. But sometimes you may need to put data somewhere outside your AUT workspace - anywhere on your disc
space. Folder Context was coined for this purpose. When it is applied it puts files into a selected root folder.</p>
<p><p>Move a mouse over highlighted areas on a screenshot below to get a documentation regarding UI elements</p>
</p>
<div class="screenshot">
<img src="https://www.eclipse.org/rcptt/shared/img/screenshot-folder-context-editor.png"></img>
<div class="ann" style="top:93px;left:118px;">
<div class="ann-border" style="width:100px;height:19px;"></div>
<div class="ann-overlay" style="left:0px;;">
All you need to know about context name
</div>
</div>
<div class="ann" style="top:119px;left:118px;">
<div class="ann-border" style="width:100px;height:19px;"></div>
<div class="ann-overlay" style="left:0px;;">
All you need to know about tags
</div>
</div>
<div class="ann" style="top:118px;left:584px;">
<div class="ann-border" style="width:22px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
All you need to know about adding tags
</div>
</div>
<div class="ann" style="top:92px;left:616px;">
<div class="ann-border" style="width:75px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
Make a snapshot of resources from a root path and copy them into this context
</div>
</div>
<div class="ann" style="top:118px;left:616px;">
<div class="ann-border" style="width:75px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
Copy given resources into root. If <span class="uiElement">Clear root folder</span>
option is on, removes existing resources from a root first.
</div>
</div>
<div class="ann" style="top:202px;left:626px;">
<div class="ann-border" style="width:59px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
Launch Open File dialog to select root path
</div>
</div>
<div class="ann" style="top:202px;left:145px;">
<div class="ann-border" style="width:471px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
When a context is applied - given resources are copied into a root location. If <span class="uiElement">Clear root folder</span>
option is on, existing resources are removed from a root first.
</div>
</div>
<div class="ann" style="top:232px;left:75px;">
<div class="ann-border" style="width:280px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
Turned off by default. Whether a root folder should be cleaned before the context is applied
</div>
</div>
<div class="ann" style="top:262px;left:75px;">
<div class="ann-border" style="width:499px;height:72px;"></div>
<div class="ann-overlay" style="left:0px;;">
Resources area lists current resources
</div>
</div>
<div class="ann" style="top:262px;left:584px;">
<div class="ann-border" style="width:101px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
Import files into a context
</div>
</div>
<div class="ann" style="top:287px;left:584px;">
<div class="ann-border" style="width:101px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
Import folder into a context.
</div>
</div>
<div class="ann" style="top:312px;left:584px;">
<div class="ann-border" style="width:101px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
Remove selected resource(s) from a folder context
</div>
</div>
</div>
<p>Above is a Folder Context which puts <i>img1.jpg</i> and <i>img2.jpg</i> files in a <i>TestData</i> folder on a <i>C</i> disc.<br />
You can also add a folder with files:</p>
<div class="screenshot">
<img src="https://www.eclipse.org/rcptt/shared/img/screenshot-folder-context-editor-2.png"></img>
</div>
<p><i>TestImages</i> folder with 2 files will be added to a root location when the context above is applied.</p>
<h3>Root Path</h3>
<p>Folder context can use a relative path to a current User Directory or to AUT workspace.</p>
<p>Let's say you need to place img1 and img2 files into <i>C://CurrentUserDirectory/TestData/</i>.
When you select it as a root path you will see that RCPTT replaces it with <i>home://TestData/</i></p>
<div class="screenshot">
<img src="https://www.eclipse.org/rcptt/shared/img/screenshot-folder-context-editor-3.png"></img>
</div>
<p>Which means that a folder context will pass regardless of the Current User Directory name.</p>
<p>Likewise, AUT workspace path is replaced with <i>workspace://</i> which makes Folder Context act almost
like a <a href = "https://www.eclipse.org/rcptt/documentation/userguide/contexts/workspace">Workspace context</a>:</p>
<div class="screenshot">
<img src="https://www.eclipse.org/rcptt/shared/img/screenshot-folder-context-editor-4.png"></img>
</div>
<p>If there is no TestData folder - it will be created.</p>
<p>If there already is TestData folder - its content will be <b>merged</b> with a context
content (only if <span class="uiElement">Clear root folder</span>
option is disabled).</p>
<h3>Clear root folder option</h3>
<p>Like in a <a href = "https://www.eclipse.org/rcptt/documentation/userguide/contexts/workspace">Workspace context</a> there is an option - Clear root
folder before context application (disabled when the context is created).</p>
<div class="screenshot">
<img src="https://www.eclipse.org/rcptt/shared/img/screenshot-folder-context-editor-5.png"></img>
<div class="ann" style="top:232px;left:75px;">
<div class="ann-border" style="width:280px;height:22px;"></div>
<div class="ann-overlay" style="left:0px;;">
Turned off by default. Whether a root folder should be cleaned before the context is applied
</div>
</div>
</div>
<p>Been enabled it leads to clearing a root folder before the context is applied.</p>
<p>When the context above is applied all TestData content is deleted and then <i>TestImages</i> folder with <i>img1</i>, <i>img2</i> files are placed there.</p>
<div class="panel panel-danger">
<div class="panel-heading">Important</div>
<div class="panel-body">
Please be careful with root folder path - once you set something
like <i>home://</i> or <i>file://C:/</i> and enable <span class="uiElement">Clear root folder</span>
option - all your
root content will be completely deleted once a context is applied.
Please make sure that your root path is followed by any other folder like <i>home://TestData</i>.
</div>
</div>
<h3>Test example: File Import</h3>
<p>Let's say you need to test that file import works correctly.
To do this you're going to import two files from a <i>//Desktop/TestData</i> into your Project1 using a Resource Perspective.</p>
<p>You need the following contexts for your test:</p>
<ol>
<li>
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/workspace">Workspace context</a> - to clear your AUT workspace and put Project1 there:
<div class="screenshot">
<img src="https://www.eclipse.org/rcptt/shared/img/screenshot-folder-context-editor-6.png"></img>
</div>
</li>
<li>
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/workspace">Workbench context</a> - to open a Resource Perspective with Project Explorer view:
<div class="screenshot">
<img src="https://www.eclipse.org/rcptt/shared/img/screenshot-folder-context-editor-7.png"></img>
</div>
</li>
<li>Folder Context - to put files for import into a <i>home://Desktop/TestData folder</i> (or to create this folder if there's no any):
<div class="screenshot">
<img src="https://www.eclipse.org/rcptt/shared/img/screenshot-folder-context-editor-8.png"></img>
</div>
</li>
<div>
Next, create a test case and add these three contexts into it and start recording - the contexts will be applied to make everything ready for a file Import:
</div>
<div class="screenshot">
<img src="https://www.eclipse.org/rcptt/shared/img/screenshot-folder-context-editor-9.png"></img>
</div>
Do not forget to add an <a href="https://www.eclipse.org/rcptt/documentation/userguide/assertions">assertion</a> to verify that the images were successfully imported into a Project1 (see the selected script).
</ol>
</div>
</div>
</div>
</section>
<script src="https://www.eclipse.org/rcptt/shared/js/main.js"></script>
</body>