Skip to content

Commit

Permalink
End-to-end test with image uploading and downloading.
Browse files Browse the repository at this point in the history
  • Loading branch information
msyk committed Jun 8, 2024
1 parent e7d98b7 commit 58c5a6a
Show file tree
Hide file tree
Showing 24 changed files with 442 additions and 40 deletions.
5 changes: 3 additions & 2 deletions samples/E2E-Test/AuthPage/Auth_credential_2fa_MySQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ <h1>Testing Authentication</h1>
<div data-im="testtable@dt1"></div>
<div data-im="testtable@text1"></div>
</td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="../../../index.php?deffile=Auth_credential_2fa_MySQL.yaml&media=" style="width: 50px" data-im="testtable@text1@#src">
<img src="../../../index.php?deffile=Auth_credential_2fa_MySQL.yaml&media="
style="width: 50px" data-im="testtable@text1@#src" class="_im_test-file_show">
</td>
<td>
<table>
Expand Down
5 changes: 3 additions & 2 deletions samples/E2E-Test/AuthPage/Auth_credential_2fa_PostgreSQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ <h1>Testing Authentication</h1>
<div data-im="testtable@dt1"></div>
<div data-im="testtable@text1"></div>
</td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="../../../index.php?deffile=Auth_credential_2fa_PostgreSQL.yaml&media=" style="width: 50px" data-im="testtable@text1@#src">
<img src="../../../index.php?deffile=Auth_credential_2fa_PostgreSQL.yaml&media="
style="width: 50px" data-im="testtable@text1@#src" class="_im_test-file_show">
</td>
<td>
<table>
Expand Down
2 changes: 1 addition & 1 deletion samples/E2E-Test/AuthPage/Auth_credential_2fa_SQLite.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h1>Testing Authentication</h1>
<div data-im="testtable_auth@dt1"></div>
<div data-im="testtable_auth@text1"></div>
</td>
<td data-im="testtable_auth@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable_auth@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp></td>
<td>
<img src="Auth_credential_2fa_SQLite.php?media=" style="width: 50px" data-im="testtable_auth@text1@#src">
</td>
Expand Down
5 changes: 3 additions & 2 deletions samples/E2E-Test/AuthPage/Auth_credential_aws_MySQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ <h1>Testing Authentication</h1>
<div data-im="testtable@dt1"></div>
<div data-im="testtable@text1"></div>
</td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="../../../index.php?deffile=Auth_credential_aws_MySQL.yaml&media=" style="width: 50px" data-im="testtable@text1@#src">
<img src="../../../index.php?deffile=Auth_credential_aws_MySQL.yaml&media="
style="width: 50px" data-im="testtable@text1@#src" class="_im_test-file_show">
</td>
<td></td>
</tr>
Expand Down
5 changes: 3 additions & 2 deletions samples/E2E-Test/AuthPage/Auth_credential_basic_MySQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ <h1>Testing Authentication</h1>
<div data-im="testtable@dt1"></div>
<div data-im="testtable@text1"></div>
</td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="../../../index.php?deffile=Auth_credential_basic_MySQL.yaml&media=" style="width: 50px" data-im="testtable@text1@#src">
<img src="../../../index.php?deffile=Auth_credential_basic_MySQL.yaml&media="
style="width: 50px" data-im="testtable@text1@#src" class="_im_test-file_show">
</td>
<td>
<table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ <h1>Testing Authentication</h1>
<div data-im="testtable@dt1"></div>
<div data-im="testtable@text1"></div>
</td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="../../../index.php?deffile=Auth_credential_basic_PostgreSQL.yaml&media=" style="width: 50px" data-im="testtable@text1@#src">
<img src="../../../index.php?deffile=Auth_credential_basic_PostgreSQL.yaml&media="
style="width: 50px" data-im="testtable@text1@#src" class="_im_test-file_show">
</td>
<td>
<table>
Expand Down
7 changes: 4 additions & 3 deletions samples/E2E-Test/AuthPage/Auth_credential_basic_SQLite.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ <h1>Testing Authentication</h1>
<div data-im="testtable_auth@dt1"></div>
<div data-im="testtable_auth@text1"></div>
</td>
<td data-im="testtable_auth@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable_auth@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="Auth_credential_basic_SQLite.php?media=" style="width: 50px" data-im="testtable_auth@text1@#src">
<img src="Auth_credential_basic_SQLite.php?media=" style="width: 50px" class="_im_test-file_show"
data-im="testtable_auth@text1@#src">
</td>
<td>
<td>
<table>
<tbody>
<tr>
Expand Down
13 changes: 5 additions & 8 deletions samples/E2E-Test/AuthPage/Auth_credential_email_MySQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<div class="container">
<h1>Testing Authentication</h1>
<button id="logout_link" onclick="INTERMediatorOnPage.logout();location.reload()">Logout</button>
<!-- <div id="IM_NAVIGATOR"></div>-->
<!-- <div id="IM_NAVIGATOR"></div>-->
<table>
<thead>
<tr>
Expand All @@ -50,19 +50,16 @@ <h1>Testing Authentication</h1>
</tr>
</thead>
<tbody>
<tr>
<th colspan="100">

</th>
</tr>
<tr>
<td>
<div data-im="testtable@dt1"></div>
<div data-im="testtable@text1"></div>
<div data-im="testtable@text2" class="_im_test-username"></div>
</td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="../../../index.php?deffile=Auth_credential_email_MySQL.yaml&media=" style="width: 50px" data-im="testtable@text1@#src">
<img src="../../../index.php?deffile=Auth_credential_email_MySQL.yaml&media="
style="width: 50px" data-im="testtable@text1@#src" class="_im_test-file_show">
</td>
<td>
<table>
Expand Down
7 changes: 5 additions & 2 deletions samples/E2E-Test/AuthPage/Auth_credential_email_MySQL.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ contexts:
- name: testtable
key: id
records: 10
paging: true
sort: [{ field: dt1, direction: desc }]
file-upload: [{ field: text1, context: fileupload }]
post-reconstruct: true
repeat-control: insert delete
authentication: { media-handling: true }
authentication:
media-handling: true
all:
target: field-user
field: text2
- name: fileupload
key: id
relation: [{ foreign-key: f_id, join-field: id, operator: = }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ <h1>Testing Authentication</h1>
<td>
<div data-im="testtable@dt1"></div>
<div data-im="testtable@text1"></div>
<div data-im="testtable@text2" class="_im_test-username"></div>
</td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="../../../index.php?deffile=Auth_credential_email_PostgreSQL.yaml&media=" style="width: 50px" data-im="testtable@text1@#src">
<img src="../../../index.php?deffile=Auth_credential_email_PostgreSQL.yaml&media="
style="width: 50px" data-im="testtable@text1@#src" class="_im_test-file_show">
</td>
<td>
<table>
Expand Down
14 changes: 9 additions & 5 deletions samples/E2E-Test/AuthPage/Auth_credential_email_PostgreSQL.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ contexts:
- name: testtable
key: id
records: 10000
sort: [{ field: dt1, direction: desc }]
file-upload: [{ field: text1, context: fileupload }]
sort: [ { field: dt1, direction: desc } ]
file-upload: [ { field: text1, context: fileupload } ]
post-reconstruct: true
repeat-control: insert delete,
authentication: { media-handling: true }
repeat-control: insert delete
authentication:
media-handling: true
all:
target: field-user
field: text2
- name: fileupload
key: id
relation: [{ foreign-key: f_id, join-field: id, operator: = }]
relation: [ { foreign-key: f_id, join-field: id, operator: = } ]
options:
media-root-dir: /tmp
authentication:
Expand Down
6 changes: 4 additions & 2 deletions samples/E2E-Test/AuthPage/Auth_credential_email_SQLite.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ <h1>Testing Authentication</h1>
<td>
<div data-im="testtable_auth@dt1"></div>
<div data-im="testtable_auth@text1"></div>
<div data-im="testtable_auth@text2" class="_im_test-username"></div>
</td>
<td data-im="testtable_auth@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable_auth@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="Auth_credential_email_SQLite.php?media=" style="width: 50px" data-im="testtable_auth@text1@#src">
<img src="Auth_credential_email_SQLite.php?media=" style="width: 50px"
data-im="testtable_auth@text1@#src" class="_im_test-file_show">
</td>
<td>
<table>
Expand Down
5 changes: 4 additions & 1 deletion samples/E2E-Test/AuthPage/Auth_credential_email_SQLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
"records" => 10000,
"sort" => [["field" => "dt1", "direction" => "DESC",],],
"file-upload" => [["field" => "text1", "context" => "fileupload"],],
"authentication" => ["media-handling" => true],
"authentication" => [
"media-handling" => true,
"all" => ["target" => "field-user", "field" => "text2"],
],
],
[
"name" => "fileupload",
Expand Down
5 changes: 3 additions & 2 deletions samples/E2E-Test/AuthPage/Auth_session-storage_MySQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ <h1>Testing Authentication</h1>
<div data-im="testtable@dt1"></div>
<div data-im="testtable@text1"></div>
</td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="../../../index.php?deffile=Auth_session-storage_MySQL.yaml&media=" style="width: 50px" data-im="testtable@text1@#src">
<img src="../../../index.php?deffile=Auth_session-storage_MySQL.yaml&media="
style="width: 50px" data-im="testtable@text1@#src" class="_im_test-file_show">
</td>
<td>
<table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ <h1>Testing Authentication</h1>
<div data-im="testtable@dt1"></div>
<div data-im="testtable@text1"></div>
</td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="../../../index.php?deffile=Auth_session-storage_PostgreSQL.yaml&media=" style="width: 50px" data-im="testtable@text1@#src">
<img src="../../../index.php?deffile=Auth_session-storage_PostgreSQL.yaml&media="
style="width: 50px" data-im="testtable@text1@#src" class="_im_test-file_show">
</td>
<td>
<table>
Expand Down
5 changes: 3 additions & 2 deletions samples/E2E-Test/AuthPage/Auth_session-storage_SQLite.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ <h1>Testing Authentication</h1>
<div data-im="testtable_auth@dt1"></div>
<div data-im="testtable_auth@text1"></div>
</td>
<td data-im="testtable_auth@text1" data-im-widget="jquery_fileupload"></td>
<td data-im="testtable_auth@text1" data-im-widget="jquery_fileupload" class="_im_test-file_comp"></td>
<td>
<img src="Auth_session-storage_SQLite.php?media=" style="width: 50px" data-im="testtable_auth@text1@#src">
<img src="Auth_session-storage_SQLite.php?media=" style="width: 50px"
data-im="testtable_auth@text1@#src">
</td>
<td>
<table>
Expand Down
25 changes: 25 additions & 0 deletions spec/run/test/pageobjects/AuthPage/auth.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@ module.exports = class AuthPage extends IMPage {
get logoutLink() {
return $("#logout_link")
}

get itemInsertButton() {
return $('.IM_Button_Insert')
}

get itemDeleteButton() {
return $$('.IM_Button_Delete')
}

get fieldsItemWidget() {
return $$('[data-im-widget="jquery_fileupload"]')
}

get fieldsItemUploading() {
return $$("._im_test-file_comp")
}

get fieldsItemPic() {
return $$("._im_test-file_show")
}

get fieldsUsername() {
return $$("._im_test-username")
}

}

// module.exports = new FormPage();
10 changes: 10 additions & 0 deletions spec/run/test/specs/media_mysql.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const AuthPage = require('../pageobjects/AuthPage/auth_page_credential_basic_mysql.page');
const AuthPageUser = require('../pageobjects/AuthPage/auth_page_credential_email_mysql.page');
const fileTest = require('./ui_tests/file_updown')

describe('File Upload and Download with MySQL', () => {
fileTest(AuthPage, false)
fileTest(AuthPageUser, true)
})


10 changes: 10 additions & 0 deletions spec/run/test/specs/media_postgresql.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const AuthPage = require('../pageobjects/AuthPage/auth_page_credential_basic_postgresql.page');
const AuthPageUser = require('../pageobjects/AuthPage/auth_page_credential_email_postgresql.page');
const fileTest = require('./ui_tests/file_updown')

describe('File Upload and Download with PostgreSQL', () => {
fileTest(AuthPage, false)
fileTest(AuthPageUser, true)
})


10 changes: 10 additions & 0 deletions spec/run/test/specs/media_sqlite.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const AuthPage = require('../pageobjects/AuthPage/auth_page_credential_basic_sqlite.page');
const AuthPageUser = require('../pageobjects/AuthPage/auth_page_credential_email_sqlite.page');
const fileTest = require('./ui_tests/file_updown')

describe('File Upload and Download with SQLite', () => {
fileTest(AuthPage,false)
fileTest(AuthPageUser,true)
})


Loading

0 comments on commit 58c5a6a

Please sign in to comment.