fix: test runner

This commit is contained in:
tiddlygit-test 2021-06-18 01:41:21 +08:00
parent 3392f01fa9
commit 1f34fba261
11 changed files with 13 additions and 7 deletions

View file

@ -12,16 +12,16 @@ Feature: Open
Given the app is launched Given the app is launched
Then the element "#add-workspace-button" is on the page Then the element "#add-workspace-button" is on the page
Then click on this element Then click on this element
Then "Add Workspace" window show up Then " tiddlywiki" window show up
Scenario: Opening Preferences Page Scenario: Opening Preferences Page
Given the app is launched Given the app is launched
Then the element "#open-preferences-button" is on the page Then the element "#open-preferences-button" is on the page
Then click on this element Then click on this element
Then "Preferences" window show up Then "..." window show up
Scenario: Opening Notifications Page Scenario: Opening Notifications Page
Given the app is launched Given the app is launched
Then the element "#open-notification-settings-button" is on the page Then the element "#open-notification-settings-button" is on the page
Then click on this element Then click on this element
Then "Notifications" window show up Then "..." window show up

View file

@ -16,7 +16,7 @@
"ContextMenu": { "ContextMenu": {
"OpenTiddlyGit": "打开太记", "OpenTiddlyGit": "打开太记",
"OpenLinkInNewWindow": "在新窗口中打开链接", "OpenLinkInNewWindow": "在新窗口中打开链接",
"Preferences": "设置", "Preferences": "设置...",
"TiddlyGitSupport": "TiddlyGit 用户支持", "TiddlyGitSupport": "TiddlyGit 用户支持",
"TiddlyGitWebsite": "TiddlyGit 官网", "TiddlyGitWebsite": "TiddlyGit 官网",
"Quit": "退出", "Quit": "退出",
@ -110,7 +110,7 @@
"CreatePublicRepository": "创建公开仓库", "CreatePublicRepository": "创建公开仓库",
"CreatePrivateRepository": "创建私有仓库", "CreatePrivateRepository": "创建私有仓库",
"Reload": "重新加载", "Reload": "重新加载",
"Processing": "正在处理", "Processing": "正在处理...",
"WaitForLogin": "等待登录", "WaitForLogin": "等待登录",
"CanNotLoadList": "无法加载仓库列表,网络不佳", "CanNotLoadList": "无法加载仓库列表,网络不佳",
"OmitMoreResult": "列表仅展示前 {{loadCount}} 个结果", "OmitMoreResult": "列表仅展示前 {{loadCount}} 个结果",

View file

@ -81,6 +81,7 @@ export default function About(): JSX.Element {
return ( return (
<DialogContent> <DialogContent>
<div id="test" data-usage="For spectron automating testing" />
<Helmet> <Helmet>
<title>{t('ContextMenu.About')}</title> <title>{t('ContextMenu.About')}</title>
</Helmet> </Helmet>

View file

@ -75,6 +75,7 @@ export default function AddWorkspace(): JSX.Element {
return ( return (
<TabContext value={currentTab}> <TabContext value={currentTab}>
<div id="test" data-usage="For spectron automating testing" />
<Helmet> <Helmet>
<title> <title>
{t('AddWorkspace.AddWorkspace')} {wikiFolderName} {t('AddWorkspace.AddWorkspace')} {wikiFolderName}

View file

@ -160,6 +160,7 @@ export default function EditWorkspace(): JSX.Element {
} }
return ( return (
<Root> <Root>
<div id="test" data-usage="For spectron automating testing" />
<Helmet> <Helmet>
<title> <title>
{t('WorkspaceSelector.EditWorkspace')} {String(workspace.order ?? 1)} {workspace.name} {t('WorkspaceSelector.EditWorkspace')} {String(workspace.order ?? 1)} {workspace.name}

View file

@ -200,6 +200,7 @@ export default function Main(): JSX.Element {
const { attachToMenubar, titleBar, sidebar, pauseNotifications, themeSource, sidebarShortcutHints } = preferences; const { attachToMenubar, titleBar, sidebar, pauseNotifications, themeSource, sidebarShortcutHints } = preferences;
return ( return (
<OuterRoot> <OuterRoot>
<div id="test" data-usage="For spectron automating testing" />
<Helmet> <Helmet>
<title>{t('Menu.TiddlyGit')}</title> <title>{t('Menu.TiddlyGit')}</title>
</Helmet> </Helmet>

View file

@ -172,6 +172,7 @@ export default function Notifications(): JSX.Element {
return ( return (
<Root> <Root>
<div id="test" data-usage="For spectron automating testing" />
<Helmet> <Helmet>
<title>{t('ContextMenu.Notifications')}</title> <title>{t('ContextMenu.Notifications')}</title>
</Helmet> </Helmet>

View file

@ -216,6 +216,7 @@ export default function Preferences(): JSX.Element {
return ( return (
<Root> <Root>
<div id="test" data-usage="For spectron automating testing" />
<Helmet> <Helmet>
<title>{t('ContextMenu.Preferences')}</title> <title>{t('ContextMenu.Preferences')}</title>
</Helmet> </Helmet>

View file

@ -53,6 +53,7 @@ export default function SpellcheckLanguages(): JSX.Element {
} }
return ( return (
<Root> <Root>
<div id="test" data-usage="For spectron automating testing" />
<Helmet> <Helmet>
<title>{t('Preference.SpellCheckLanguages')}</title> <title>{t('Preference.SpellCheckLanguages')}</title>
</Helmet> </Helmet>

View file

@ -30,7 +30,6 @@ function App(): JSX.Element {
<CssBaseline /> <CssBaseline />
<React.Suspense fallback={<div />}> <React.Suspense fallback={<div />}>
<I18nextProvider i18n={i18n}> <I18nextProvider i18n={i18n}>
<div id="test" data-usage="For spectron automating testing" />
<Pages /> <Pages />
</I18nextProvider> </I18nextProvider>
</React.Suspense> </React.Suspense>

View file

@ -19,7 +19,7 @@ exports.main = _.compact([
// to is relative to ./.webpack/main/ // to is relative to ./.webpack/main/
patterns: [{ from: 'localization', to: 'localization' }], patterns: [{ from: 'localization', to: 'localization' }],
}), }),
process.env.NODE_ENV === 'production' && ['production', 'test'].includes(process.env.NODE_ENV) &&
new EventHooksPlugin({ new EventHooksPlugin({
afterEmit: async (compilation, done) => { afterEmit: async (compilation, done) => {
console.log('Copying tiddlywiki dependency to dist'); console.log('Copying tiddlywiki dependency to dist');