gen doc for functional test

This commit is contained in:
monoid 2022-06-11 17:20:41 +09:00
parent 918a4eeb52
commit 2d393515c4
2 changed files with 45 additions and 256 deletions

View File

@ -74,262 +74,36 @@ setting: defered register ... ok (16ms)
test result: ok. 35 passed (15 steps); 0 failed; 0 ignored; 0 measured; 0 filtered out (2s) test result: ok. 35 passed (15 steps); 0 failed; 0 ignored; 0 measured; 0 filtered out (2s)
``` ```
## 6.2 기능 테스트(Functional Test) ## 6.2 기능 테스트(Functional Test)
### Chunk <% const keys = Array.from(it.table.keys()); %>
<table> <% keys.forEach(c=>{
<thead> const issues = it.table.get(c);
<tr> const ts = issues.map(x=> it.testcases.filter(y=>y.id==x.number)).flat();
<th>ID</th> if(ts?.length == 0) return; %>
<th>Content</th> <%~`\n\n### ${c}\n\n`%>
<th>Procedure</th> <%~"<table>"%>
<th>Test Data</th> <%~"<thead>"%>
<th>P/F</th> <%~"<tr>"%>
</tr> <%~"<th>ID</th>"%>
</thead> <%~"<th>Content</th>"%>
<tbody> <%~"<th>Procedure</th>"%>
<tr> <%~"<th>Test Data</th>"%>
<td>1</td> <%~"<th>P/F</th>"%>
<td>Focus/Unfocus</td> <%~"</tr>"%>
<td>1. 청크를 클릭한다.</td> <%~"</thead>"%>
<td></td> <%~"<tbody>"%>
<td>P</td> <% ts.forEach((y,i)=>{
</tr> const id = y.subId ? `${y.id}-${y.subId}` : y.id;%>
<tr> <%~"<tr>"%>
<td>2</td> <%~`<td>${id}</td>`%>
<td>remove</td> <%~`<td>${y.content}</td>`%>
<td>1. 청크를 삭제하는 버튼을 클릭한다.</td> <%~`<td>${y.procedure}</td>`%>
<td></td> <%~`<td>${y.testData ?? ""}</td>`%>
<td>P</td> <%~`<td>${y.pass ? "P" : "F"}</td>`%>
</tr> <%~"</tr>"%>
<tr> <%});%>
<td>3-1</td> <%~"</tbody>"%>
<td>render - markdown</td> <%~"</table>"%>
<td>1. 마크다운 청크 렌더링을 확인한다.</td> <% });%>
<td> # 제목 </td>
<td>P</td>
</tr>
<tr>
<td>3-2</td>
<td>render - latex</td>
<td>1. LaTex 청크 렌더링을 확인한다.</td>
<td> sum^n_{n=0}n = \frac{n(n+1)}2$$ </td>
<td>P</td>
</tr>
<tr>
<td>3-3</td>
<td>render - link</td>
<td>1. Image 청크 렌더링을 확인한다.</td>
<td>http://picsum.photos</td>
<td>P</td>
</tr>
<tr>
<td>4</td>
<td>previews</td>
<td>1. Katex 청크의 미리보기를 본다.</td>
<td> sum^n_{n=0}n = \frac{n(n+1)}2$$ </td>
<td>F</td>
</tr>
<tr>
<td>10</td>
<td>autocomplete</td>
<td>1. <kbd>Ctrl+Space</kbd>를 눌러 자동완성을 시도한다.</td>
<td></td>
<td>F</td>
</tr>
<tr>
<td>11</td>
<td>swap positions</td>
<td>1. 청크의 위치를 바꾼다.</td>
<td></td>
<td>P</td>
</tr>
<tr>
<td>27-1</td>
<td>edit</td>
<td>1. 청크를 수정한다.</td>
<td></td>
<td>P</td>
</tr>
<tr>
<td>27-2</td>
<td>edit chunk conflict</td>
<td>1. 청크를 수정모드에 들어간다.</td>
<td></td>
<td>F</td>
</tr>
</tbody>
</table>
### Document
<table>
<thead>
<tr>
<th>ID</th>
<th>Content</th>
<th>Procedure</th>
<th>Test Data</th>
<th>P/F</th>
</tr>
</thead>
<tbody>
<tr>
<td>5</td>
<td>view Chunk</td>
<td>1. 문서를 열어 청크가 렌더링되는지 본다.</td>
<td>test.syd</td>
<td>P</td>
</tr>
<tr>
<td>7</td>
<td>add/delete tag</td>
<td>1. 문서에 태그를 추가한다.<br>2. 문서에 태그를 삭제한다.</td>
<td>A</td>
<td>P</td>
</tr>
<tr>
<td>8</td>
<td>Drag And Drop Upload,</td>
<td>1. 텍스트를 드래그한다.</td>
<td></td>
<td>P</td>
</tr>
</tbody>
</table>
### File
<table>
<thead>
<tr>
<th>ID</th>
<th>Content</th>
<th>Procedure</th>
<th>Test Data</th>
<th>P/F</th>
</tr>
</thead>
<tbody>
<tr>
<td>14</td>
<td>create/delete/rename file</td>
<td>1. 파일을 만든다.</td>
<td>test.txt</td>
<td>P</td>
</tr>
<tr>
<td>15</td>
<td>upload/download files</td>
<td>1. 파일을 업로드한다.</td>
<td>test.txt</td>
<td>P</td>
</tr>
<tr>
<td>18</td>
<td>export document</td>
<td>1. export 버튼을 누른다.</td>
<td></td>
<td>F</td>
</tr>
</tbody>
</table>
### Search
<table>
<thead>
<tr>
<th>ID</th>
<th>Content</th>
<th>Procedure</th>
<th>Test Data</th>
<th>P/F</th>
</tr>
</thead>
<tbody>
<tr>
<td>16</td>
<td>Document Search</td>
<td>1. 검색버튼을 눌러 검색을 한다.</td>
<td>chunk</td>
<td>F</td>
</tr>
</tbody>
</table>
### Stash
<table>
<thead>
<tr>
<th>ID</th>
<th>Content</th>
<th>Procedure</th>
<th>Test Data</th>
<th>P/F</th>
</tr>
</thead>
<tbody>
<tr>
<td>17</td>
<td>render</td>
<td>1. 스태시가 그려지는지 확인한다</td>
<td></td>
<td>P</td>
</tr>
<tr>
<td>19</td>
<td>add</td>
<td>1. 청크를 추가한다</td>
<td></td>
<td>P</td>
</tr>
<tr>
<td>20</td>
<td>remove</td>
<td>1. 청크를 삭제한다</td>
<td></td>
<td>P</td>
</tr>
<tr>
<td>21</td>
<td>Drag and Drop to Document</td>
<td>1. 청크로부터 문서로 청크를 옮긴다.</td>
<td></td>
<td>P</td>
</tr>
</tbody>
</table>
### Management
<table>
<thead>
<tr>
<th>ID</th>
<th>Content</th>
<th>Procedure</th>
<th>Test Data</th>
<th>P/F</th>
</tr>
</thead>
<tbody>
<tr>
<td>22</td>
<td>Login</td>
<td>1. 비밀번호를 입력한다.</td>
<td>admin</td>
<td>F</td>
</tr>
<tr>
<td>24</td>
<td>Localization</td>
<td>1. 다른언어를 지원하는지 언어를 바꿔 확인한다</td>
<td></td>
<td>F</td>
</tr>
</tbody>
</table>

View File

@ -4,6 +4,20 @@ import { WriterHandler } from "https://deno.land/std@0.143.0/log/handlers.ts";
import * as Eta from "https://deno.land/x/eta@v1.12.3/mod.ts"; import * as Eta from "https://deno.land/x/eta@v1.12.3/mod.ts";
import { Issue } from "./githubType.ts"; import { Issue } from "./githubType.ts";
import testcaseData from "./testcases.json" assert { type: "json"};
type Testcase = {
id: number,
subId: number | null,
content: string,
procedure: string,
testData: string| null,
expected: string,
actual: string,
pass: boolean
}
const testcases = testcaseData as Testcase[];
class StderrHandler extends WriterHandler { class StderrHandler extends WriterHandler {
protected _writer: Deno.Writer; protected _writer: Deno.Writer;
#encoder: TextEncoder; #encoder: TextEncoder;
@ -111,6 +125,7 @@ async function main(args: string[]) {
table: table, table: table,
gitHash: gitHash, gitHash: gitHash,
toHeadId: toHeadId, toHeadId: toHeadId,
testcases: testcases
}) as string; }) as string;
} }
}) })