Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 23749aa

Browse files
author
Shevtsov, Dmitry(dshevtsov)
committed
Merge pull request #4 from Magento/pubs2411-block
Pubs2411 Block and Page
2 parents d957514 + ffce775 commit 23749aa

28 files changed

+837
-203
lines changed

_includes/mtf/block_attributes.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div markdown="1">
2+
3+
See the `block` node attributes details in the following table:
4+
5+
|`block` attribute | Description | Is required|Values| Example|
6+
|---|---|---|---|---|
7+
|`name`| Name of the block| Required|Unique in the page. The method to get the block class instance is generated using this value.|`widgetGrid`|
8+
|`class`| Full name of the block class |Required| Class name |`Magento\Widget\Test\Block\Adminhtml\Widget\WidgetGrid` |
9+
|`locator`| CSS selector or XPath locator of the block|Required|[CSS Selectors](http://www.w3.org/TR/selectors/), <a href="http://www.w3.org/TR/xpath-31/">XPath</a>|CSS: `#widgetInstanceGrid`, XPath: `//*[@id="widgetInstanceGrid"]`|
10+
|`strategy` |Selector strategy| Required|`css selector` or `xpath`| `css selector`|
11+
12+
</div>

_includes/mtf/page-generator.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>To apply all changes you've made to the page (XML file), run the page generator.</p>
2+
<pre><code>php &lt;magento2&gt;/dev/tests/functional/utils/page.php</code></pre>
3+
<p>The page will be updated in the <code>&lt;magento2&gt;/dev/tests/functional/generated</code> directory.</p>

_plugins/remote_markdown.rb

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# "THE BEER-WARE LICENSE" (Revision 42):
2+
# <[email protected]> wrote this file. As long as you retain this
3+
# notice you can do whatever you want with this stuff. If we meet some day, and
4+
# you think this stuff is worth it, you can buy me a beer in return.
5+
# Robin Hahling
6+
7+
require 'net/http'
8+
9+
module Jekyll
10+
# Remotely fetch a markdown file.
11+
class RemoteMarkdownTag < Liquid::Tag
12+
def initialize(tag_name, text, tokens)
13+
super
14+
15+
text.strip!
16+
check_protocol(text)
17+
uri = URI(text)
18+
19+
check_extension(uri.path)
20+
21+
res = Net::HTTP.get_response(uri)
22+
fail 'resource unavailable' unless res.is_a?(Net::HTTPSuccess)
23+
24+
@content = res.body.force_encoding("UTF-8")
25+
end
26+
27+
def render(_context)
28+
@content
29+
end
30+
31+
private
32+
33+
def check_protocol(text)
34+
error_message = "remote_markdown: invalid URI given #{text}"
35+
fail error_message unless text =~ URI.regexp(%w(http https ftp ftps))
36+
end
37+
38+
def check_extension(path)
39+
mdexts = %w(.markdown .mkdown .mkdn .mkd .md .xml)
40+
error_message = "remote_markdown: URI file extension not in #{mdexts}"
41+
fail error_message unless mdexts.include?(File.extname(path))
42+
end
43+
end
44+
end
45+
46+
Liquid::Template.register_tag('remote_markdown', Jekyll::RemoteMarkdownTag)
45.7 KB
Loading
13.1 KB
Loading

common/images/mtf_block_login_dir.png

6.77 KB
Loading

common/images/mtf_block_login_ui.png

122 KB
Loading
24.7 KB
Loading
14.4 KB
Loading
39.2 KB
Loading

0 commit comments

Comments
 (0)