Can I automate changing Magic Mouse 2 settings in macOS?

I’m a regular user.I often need to leave only the left button of Magic Mouse 2 active ,now I do it in the usual way:I go to the system preferences,and disable unnecessary options It takes ten clicks.After a session where I only needed the left button, I again have to repeat ten clicks to return the previous canceled options ,which is a lot

I would love an example in the Automator or another solution to automate swapping preferences rather than having to graphically select each option when it’s time to toggle my preferences. Is this possible?

integration tests – How to automate QA testing in legacy web apps?

I am wondering what specific best practices are around full integration testing (like by a QA team). I am a frontend developer working in a large legacy web app with very little frontend testing. We have a large monolith Rails app with React on the FE added on as an afterthought. We have a few React-based unit tests for each component, but the components often have complex interdependencies with other components and the backend (BE) or with third party services such as using the Stripe credit card react input field, or logging on the FE directly to datadog. We also have a few “global” integration tests with Cypress, but we have mocked out the BE. We mocked the BE because it was theoretically going to be too slow to run full integration tests on each pull request (PR). This limits us greatly in what we can test, as we can’t test saving records, or doing flows in the app, just basic rendering of the full page.

At previous companies I have used things like RainforestQA to write human-driven QA tests, but it is hard to scale. At my current company, we have a dedicated QA team who uses spreadsheets to write down all their manual tests they need to perform for each new feature (from a large product/feature brief), before they have the time to write automated tests. This list of manual tests is easily 50 to 100 scenarios for a new feature:

  • Login as this user with this set of roles for that company with these company features enabled.
  • Perform some sequence of actions.
  • During each step, check for certain results.

Our data model is fairly complicated and detailed, so we have users with roles and all kinds of custom settings, companies with all kinds of configurations and settings, and other objects even more complex than these. So there are lots of even basic variations to test in the integration tests (not counting the actual combinations of everything, just talking covering the app’s main features in large swaths by one sweeping integration test so to speak).

When they finally get around to writing automated tests (usually a few product briefs behind, or 6 months to a year behind when the feature was actually released, because we are short staffed), we use Selenium and Capybara on Rails to programmatically login and do whatever is necessary to automate the test. However, we skip out on testing integration with third parties, such as:

  • Checking if an email was sent (or something failed here).
  • Checking if a text message was sent to Twilio (or something failed here).
  • Checking if a payment was made to Stripe (or something failed here).
  • Checking if custom PDF invoices were generated.
  • Checking if some other third party thing happened.

In an ideal world, we would be testing these things automatically, as the QA team currently needs to manually test these before every release to make sure nothing is broken.

In an ideal world, we would be able to also play with time somehow, so we don’t have to wait for 30 minutes for an authorized payment to actually be charged and the email to be sent, and stuff like that.

In an ideal world we would be writing tests with Capybara/Cucumber, Cypress, or just plain Puppeteer, and it would be loading up Gmail or checking the Stripe dashboard or checking the Twilio account or some fake phone somehow that these things were successful.

In an ideal world we would be able to seed the database instantly for each PR on GitHub, so it takes less than 2-5 minutes to run the full suite of tests.

In an ideal world we would be writing full integration tests (including with third-party services) as a FE team, so QA was just formality in the end. By writing these automated tests in TDD style from the beginning, we would be simplifying our workflow greatly, as currently I have to refresh the page and click through 10, 20 clicks to reproduce some state in the app to see if my change in this deeply nested (in terms of flow) screen is the right style or integrates with the BE properly. I would like for tests to be written to programmatically perform any complicated interactions to reproduce the state.

In an ideal world, I think we should be writing full integration tests at the customer experience/perception level. That is, when given a new feature to work on, such as SSO (single-sign on) or MFA (multi-factor authentication), we should write a test that:

  1. Configures a company with SSO through the UI.
  2. Configures a user to prefer SSO through the UI.
  3. Logs in with SSO (including clicking the appropriate “approve” buttons on Google Oauth and such).
  4. Checks that we are logged into the app now (through the UI) by trying to perform some authorized action, etc..

If that’s not realistic, then what is the state of the art?

  • How can you have a full suite of integration tests, including testing integration with third-party services for a reasonably complicated app like this?
  • How can you have these integration tests run for each PR in under 5 minutes total?
  • If not possible to run that fast, what corners could be cut and how?

For example, we could separate tests into groups that run in parallel. We could perhaps run some of the tests only under certain conditions (just before release as opposed to for each PR). But when/how would we decide this?

Basically, I would like to start moving our company down the path of better integration testing of our web app and would like to know what is possible and at the same time practical for implementing within let’s say a year given just a developer or two.

sharepoint online – Question on Power Automate flow

I am creating a flow in Power Automate that is set to update/time stamp a column in a Sharepoint list when a different field is changed (the field is ‘Phase’).

I’ve created the below flow, which updates the column based on two separate conditions – (1) Has Column Changed – Phase is equal to True, and (2) Phase Value is equal to ‘Testing’. The first condition works fine on its own, however the second column causes the flow to not work as expected (the column doesn’t update).

Does anyone know what could be causing this?

Thanks in advance!

enter image description here

How to set variable in power automate (escalation, timeout scenario)

How can I set variable where are two approvals in flow?
First approval has timeout parametr and after timeout second approval start. How to set variable with two approval comments like:

if(first approval result null then set variable comments aprroval second) or if(first approval result is not null set variable comments first approval)

I try use union(body response first approval, body response second approval) in foreach but without success.

Something like this:

union(null,body response second approval) or union(body response first approval,null)

Escalation timeout power automate – SharePoint Stack Exchange

I would like to repeat that scenario

But in my flow (below) on second condition flow end.

enter image description here

enter image description here

Unable to process template language expressions for action ‘Condition’ in line ‘1’ and column ‘57970’: ‘Template language function endsWith’ expects the type of the first parameter to be a string. The type of value provided is “Null”. For details on use, please visit ”.

debian – What’s the easiest way to automate a mongodb backup?

So, I’m almost finished building my first major production web app, and am wondering how to manage backups.

Weekly cold snapshot backups via my vps online admin seem ideal – but daily downtime sounds awful for UX. Hot backups seem pointless as they cannot be trusted to not be corrupt

Perhaps I don’t need weekly snapshots – just a single one, when the server is fully set up? Of course the code will be versioned in the repo.

My server runs Debian.

Is there a way to SSH in and clone the filesystem on my local machine, before encrypting with Veracrypt, before mailing it off-site?

I suppose I don’t need to backup the entire fs on a daily basis, but definitely Mongodb.

What’s the easiest way to automate a mongodb backup?

Thanks for reading :]

Using the same Power Automate approval flow in many SharePoint document libraries

I have a working workflow in Power Automate connected to one document library. The approvers are listed in a special SharePoint group for that document library.

This workflow is using my user connections to run, but the recommendation of my organization is to use a special service account to avoid problems when a person is leaving the organization.
So I will recreate the workflow using the new credentials/connections of the service account.

The workflow is now so popular that I have been asked to add it to 20 other document libraries. If I make twenty copies of the workflows I am seeing the risk that I will get a lot of maintenance work.
For instance, if I need to add functionality I am afraid I have to do the same work in twenty different workflows.

So, can I parameterize the names of the document libraries (and its approver group)? Or are there any tricks with the deployment of the workflows that can help me (for instance Pnp PowerShell)?
What is best practice for using the same workflow for several document libraries?