Browse Source

refactor(tool,app): Use demo user for screenshots

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/538/head
jld3103 1 year ago
parent
commit
9f32e1dd96
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 6
      packages/app/integration_test/screenshot_test.dart
  2. 2
      tool/Dockerfile.dev

6
packages/app/integration_test/screenshot_test.dart

@ -52,8 +52,8 @@ Future main() async {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
final account = Account( final account = Account(
serverURL: 'http://10.0.2.2', serverURL: 'http://10.0.2.2',
username: 'user1', username: 'demo',
password: 'user1', password: 'demo',
); );
setUpAll(() async { setUpAll(() async {
@ -359,7 +359,7 @@ Future main() async {
await binding.takeScreenshot('settings_accounts'); await binding.takeScreenshot('settings_accounts');
// Go to account settings // Go to account settings
await tester.tap(find.text('user1@10.0.2.2:80')); await tester.tap(find.text('demo@10.0.2.2:80'));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
await tester.tap(find.text('Automatic')); await tester.tap(find.text('Automatic'));
await tester.pumpAndSettle(); await tester.pumpAndSettle();

2
tool/Dockerfile.dev

@ -10,6 +10,7 @@ RUN ./occ app:disable password_policy
RUN OC_PASS="user1" ./occ user:add --password-from-env --display-name "User One" user1 RUN OC_PASS="user1" ./occ user:add --password-from-env --display-name "User One" user1
RUN OC_PASS="user2" ./occ user:add --password-from-env --display-name "User Two" user2 RUN OC_PASS="user2" ./occ user:add --password-from-env --display-name "User Two" user2
RUN OC_PASS="demo" ./occ user:add --password-from-env --display-name "Demo" demo
RUN ./occ app:install news --force --allow-unstable # 21.2.0 RUN ./occ app:install news --force --allow-unstable # 21.2.0
RUN ./occ app:install notes --force --allow-unstable # 4.8.0 RUN ./occ app:install notes --force --allow-unstable # 4.8.0
@ -18,5 +19,6 @@ RUN ./occ app:install uppush --force --allow-unstable # 1.4.0
RUN ./occ app:enable password_policy RUN ./occ app:enable password_policy
RUN (sh /entrypoint.sh php -S 0.0.0.0:8080 &) && \ RUN (sh /entrypoint.sh php -S 0.0.0.0:8080 &) && \
until curl -s -o /dev/null http://localhost:8080/status.php; do true; done && \ until curl -s -o /dev/null http://localhost:8080/status.php; do true; done && \
# Do not setup the demo user here
for user in admin user1 user2; do curl -u "$user:$user" -H "ocs-apirequest: true" -s -o /dev/null http://localhost:8080/ocs/v2.php/cloud/user; done for user in admin user1 user2; do curl -u "$user:$user" -H "ocs-apirequest: true" -s -o /dev/null http://localhost:8080/ocs/v2.php/cloud/user; done
COPY --chown=www-data:www-data overlay /usr/src/nextcloud/ COPY --chown=www-data:www-data overlay /usr/src/nextcloud/

Loading…
Cancel
Save