DevOps:Doc/FlexForm/2.1/Selenium Create
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 12: Line 12:


<syntaxhighlight lang="html">
<syntaxhighlight lang="html">
<form action="get" id="GET1-1">
<form id="CREATE1-1">
   <!-- GET1-1 Selenium test-->
   <!-- CREATE1-1 Selenium test-->
   <input type="text" name="test" />
   <_create mwwrite="CREATE1-1/Test" mwtemplate="wsnone" />
   <input type="submit" value="GET1-1 test" />
  <textarea name="testing-area"></textarea>
   <input type="submit" value="CREATE1-1 test" />
</form>
</form>
</syntaxhighlight>
</syntaxhighlight>


3. In the form with id="GET1-1" type "'''MyTest'''" in the text field with name "'''test'''".
3. In the form with id="CREATE1-1" type "'''MyTest'''" in the textarea with name "'''testing-area'''".


4. Click the submit button with value "'''GET1-1 test'''".
4. Click the submit button with value "'''CREATE1-1 test'''".


5. Verify the result:
5. Verify the result:
Line 27: Line 28:
5.1 Same page is reloaded
5.1 Same page is reloaded


5.2 url will now have an argument and value of  : '''test=MyTest'''
5.2 Go to page CREATE1-1/Test it should have been created


5.3 the text field with name "'''test'''" will now have the value of "'''MyTest'''"
5.3 Check the content,it should only have '''MyTest'''


6. Change the argument in the url '''test=MyTest''' to '''test=Mytest2''' and press enter.
== CREATE1-2 using mwfollow ==
1. Create page '''Selenium/CREATE1-2'''
 
2. Add following content and save
 
<syntaxhighlight lang="html">
<form id="CREATE1-2">
  <!-- CREATE1-2 Selenium test-->
  <_create mwwrite="CREATE1-2/Test" mwtemplate="wsnone" mwfollow />
  <textarea name="testing-area"></textarea>
  <input type="submit" value="CREATE1-2 test" />
</form>
</syntaxhighlight>
 
3. In the form with id="CREATE1-2" type "'''MyTest'''" in the textarea with name "'''testing-area'''".
 
4. Click the submit button with value "'''CREATE1-2 test'''".
 
5. Verify the result:
 
5.1 You are redirected to the newly create page CREATE1-2/Test
 
5.2 Check the content,it should only have '''MyTest'''
 
== CREATE1-2 using mwfollow ==
1. Create page '''Selenium/CREATE1-2'''
 
2. Add following content and save
 
<syntaxhighlight lang="html">
<form id="CREATE1-3">
  <!-- CREATE1-3 Selenium test-->
  <_create mwwrite="CREATE1-3/Test" mwtemplate="test" mwfollow />
  <textarea name="testing-area"></textarea>
  <input type="text" name="testing-text" />
  <input type="date" name="testing-date" />
  <input type="submit" value="CREATE1-3 test" />
</form>
</syntaxhighlight>
 
3. In the form with id="CREATE1-3" type "'''MyTest'''" in the textarea with name "'''testing-area'''".
 
4. In the form with id="CREATE1-3" type "'''MyTest text'''" in the text input with name "'''testing-text'''".
 
5. In the form with id="CREATE1-3" choose "'''30-08-2023'''" as date in the date input with name "'''testing-date'''".
 
6. Click the submit button with value "'''CREATE1-3 test'''".


7. Verify the result:
7. Verify the result:


7.1 Same page is reloaded
7.1 You are redirected to the newly create page CREATE1-3/Test
 
7.2 Check the content,it should be :


7.2 url will now have an argument and value of  : '''test=MyTest2'''
<pre>
{{test
|testing-area=MyTest
|testing-text=MyTest text
|testing-date=2023-08-30
}}
</pre>


7.3 the text field with name "'''test'''" will now have the value of "'''MyTest2'''"
7.3 The date might be different depending on the MediaWiki locale setting
ws-class-props
Line 1: Line 1:
{{Doc properties
{{Csp class properties
|Subject version=2.1
|Subject version=2.1,2.5
|Doc subject=DevOps:Doc/FlexForm
|Doc subject=DevOps:Doc/FlexForm
|Doc synopsis=Selenium tests for creating pages
|Doc synopsis=Selenium tests for creating pages

Latest revision as of 08:55, 26 August 2025

Prerequisites

User Sysop/Admin or in a user group defined in the setting that allows for creating FlexForms on pages

CREATE1-1

1. Create page Selenium/CREATE1-1

2. Add following content and save

<form id="CREATE1-1">
  <!-- CREATE1-1 Selenium test-->
  <_create mwwrite="CREATE1-1/Test" mwtemplate="wsnone" />
  <textarea name="testing-area"></textarea>
  <input type="submit" value="CREATE1-1 test" />
</form>

3. In the form with id="CREATE1-1" type "MyTest" in the textarea with name "testing-area".

4. Click the submit button with value "CREATE1-1 test".

5. Verify the result:

5.1 Same page is reloaded

5.2 Go to page CREATE1-1/Test it should have been created

5.3 Check the content,it should only have MyTest

CREATE1-2 using mwfollow

1. Create page Selenium/CREATE1-2

2. Add following content and save

<form id="CREATE1-2">
  <!-- CREATE1-2 Selenium test-->
  <_create mwwrite="CREATE1-2/Test" mwtemplate="wsnone" mwfollow />
  <textarea name="testing-area"></textarea>
  <input type="submit" value="CREATE1-2 test" />
</form>

3. In the form with id="CREATE1-2" type "MyTest" in the textarea with name "testing-area".

4. Click the submit button with value "CREATE1-2 test".

5. Verify the result:

5.1 You are redirected to the newly create page CREATE1-2/Test

5.2 Check the content,it should only have MyTest

CREATE1-2 using mwfollow

1. Create page Selenium/CREATE1-2

2. Add following content and save

<form id="CREATE1-3">
  <!-- CREATE1-3 Selenium test-->
  <_create mwwrite="CREATE1-3/Test" mwtemplate="test" mwfollow />
  <textarea name="testing-area"></textarea>
  <input type="text" name="testing-text" />
  <input type="date" name="testing-date" />
  <input type="submit" value="CREATE1-3 test" />
</form>

3. In the form with id="CREATE1-3" type "MyTest" in the textarea with name "testing-area".

4. In the form with id="CREATE1-3" type "MyTest text" in the text input with name "testing-text".

5. In the form with id="CREATE1-3" choose "30-08-2023" as date in the date input with name "testing-date".

6. Click the submit button with value "CREATE1-3 test".

7. Verify the result:

7.1 You are redirected to the newly create page CREATE1-3/Test

7.2 Check the content,it should be :

{{test
|testing-area=MyTest
|testing-text=MyTest text
|testing-date=2023-08-30
}}

7.3 The date might be different depending on the MediaWiki locale setting